summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-05-26 13:07:47 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-05-26 13:07:47 +0000
commitfa0570ec6eecb15c2bdc7d6a3ac2933bc74b2f3d (patch)
tree10cc97ba1f63b9dd7a37f2a10cdf1284a6e57a1c /src/couchdb/couch_httpd.erl
parent1f4b8216629f220995b0642162dcbcf98f48fd5b (diff)
Add back /_restart URL that got lost in the transition to MochiWeb.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@660183 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 26bb0915..ea614519 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -92,16 +92,18 @@ handle_request0(Req, DocumentRoot, Method, Path) ->
handle_welcome_request(Req, Method);
"/_all_dbs" ->
handle_all_dbs_request(Req, Method);
- "/favicon.ico" ->
- {ok, Req:serve_file("favicon.ico", DocumentRoot)};
"/_replicate" ->
handle_replicate_request(Req, Method);
+ "/_restart" ->
+ handle_restart_request(Req, Method);
"/_utils" ->
{ok, Req:respond({301, [{"Location", "/_utils/"}], <<>>})};
"/_utils/" ++ PathInfo ->
{ok, Req:serve_file(PathInfo, DocumentRoot)};
"/_" ++ _Path ->
throw({not_found, unknown_private_path});
+ "/favicon.ico" ->
+ {ok, Req:serve_file("favicon.ico", DocumentRoot)};
_Else ->
handle_db_request(Req, Method, {Path})
end.
@@ -135,6 +137,13 @@ handle_replicate_request(Req, 'POST') ->
handle_replicate_request(_Req, _Method) ->
throw({method_not_allowed, "POST"}).
+handle_restart_request(Req, 'POST') ->
+ couch_server:remote_restart(),
+ send_json(Req, {obj, [{ok, true}]});
+
+handle_restart_request(_Req, _Method) ->
+ throw({method_not_allowed, "POST"}).
+
% Database request handlers
handle_db_request(Req, Method, {Path}) ->