Skip to content

Commit

Permalink
Link to the reload trigger, with a helpful HTML response
Browse files Browse the repository at this point in the history
  • Loading branch information
jhs committed Nov 27, 2010
1 parent 536d6d1 commit c904be1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion example/src/webdirs.erl
Expand Up @@ -77,7 +77,7 @@ route_request(Request) ->
<<"/reload">> -> <<"/reload">> ->
?INFO("Reloading plugin", []), ?INFO("Reloading plugin", []),
_Pid = spawn(fun() -> reload() end), _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), "/"), Dirs = string:tokens(binary_to_list(Path), "/"),
case Dirs of case Dirs of
Expand Down Expand Up @@ -130,6 +130,7 @@ default_reply() ->
{Key, [Host, Port]} = Prop, {Key, [Host, Port]} = Prop,
["<li>", "<a href='/", Key, "/'>", Key, "</a> is ", Host, ":", integer_to_list(Port), "</li>"] ["<li>", "<a href='/", Key, "/'>", Key, "</a> is ", Host, ":", integer_to_list(Port), "</li>"]
end, ?WEBDIRS) end, ?WEBDIRS)
, "<li><a href='/reload'>Reload the routing policy</a></li>"
, "</ul>" , "</ul>"
, "</body></html>" , "</body></html>"
]), ]),
Expand Down

0 comments on commit c904be1

Please sign in to comment.