couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r660183 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js src/couchdb/couch_httpd.erl
Date Mon, 26 May 2008 13:07:49 GMT
Author: cmlenz
Date: Mon May 26 06:07:47 2008
New Revision: 660183

URL: http://svn.apache.org/viewvc?rev=660183&view=rev
Log:
Add back /_restart URL that got lost in the transition to MochiWeb.

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js
    incubator/couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=660183&r1=660182&r2=660183&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Mon May 26 06:07:47 2008
@@ -491,7 +491,6 @@
     restartServer();
     T(db.open(designDoc._id) == null);
     T(db.view("test/no_docs") == null);
-
   },
 
   view_collation: function(debug) {

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=660183&r1=660182&r2=660183&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd.erl Mon May 26 06:07:47 2008
@@ -92,16 +92,18 @@
             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, _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}) ->



Mime
View raw message