Permalink
Browse files

Link to the reload trigger, with a helpful HTML response

  • Loading branch information...
1 parent 536d6d1 commit c904be1acca0d90fc57296bbc9ed83c427910dbb @jhs jhs committed Nov 27, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 example/src/webdirs.erl
View
@@ -77,7 +77,7 @@ route_request(Request) ->
<<"/reload">> ->
?INFO("Reloading plugin", []),
_Pid = spawn(fun() -> reload() end),
- {reply, {200, "Reloading"}, [{'Content-Type', <<"text/plain">>}], <<"Reloading routing policy\r\n">>};
+ {reply, {200, "Reloading"}, [{'Content-Type', <<"text/html">>}], <<"Policy reloaded. <a href='/'>Try now.</a>\r\n">>};
_ ->
Dirs = string:tokens(binary_to_list(Path), "/"),
case Dirs of
@@ -130,6 +130,7 @@ default_reply() ->
{Key, [Host, Port]} = Prop,
["<li>", "<a href='/", Key, "/'>", Key, "</a> is ", Host, ":", integer_to_list(Port), "</li>"]
end, ?WEBDIRS)
+ , "<li><a href='/reload'>Reload the routing policy</a></li>"
, "</ul>"
, "</body></html>"
]),

0 comments on commit c904be1

Please sign in to comment.