diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
commit | 610064aea6eb707fe3b6a68f7c93005ceac0a2ec (patch) | |
tree | 432a31e5c0561e10f9b1e4973c2741c5c777c1f1 /src/couchdb/couch_httpd_db.erl | |
parent | dd79e85bc9e4849df904498ca25ec56304440b5f (diff) |
merge design doc resource branch. breaking changes to _view query paths.
closes COUCHDB-280
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index 005e32d1..75022cd3 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -13,7 +13,7 @@ -module(couch_httpd_db). -include("couch_db.hrl"). --export([handle_request/1, db_req/2, couch_doc_open/4]). +-export([handle_request/1, handle_design_req/2, db_req/2, couch_doc_open/4]). -import(couch_httpd, [send_json/2,send_json/3,send_json/4,send_method_not_allowed/2, @@ -41,6 +41,16 @@ handle_request(#httpd{path_parts=[DbName|RestParts],method=Method, do_db_req(Req, Handler) end. +handle_design_req(#httpd{ + path_parts=[_DbName,_Design,_DesName, <<"_",_/binary>> = Action | _Rest], + design_url_handlers = DesignUrlHandlers + }=Req, Db) -> + Handler = couch_util:dict_find(Action, DesignUrlHandlers, fun db_req/2), + Handler(Req, Db); + +handle_design_req(Req, Db) -> + db_req(Req, Db). + create_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) -> ok = couch_httpd:verify_is_server_admin(Req), case couch_server:create(DbName, [{user_ctx, UserCtx}]) of |