Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
initial version supporting creating a geospatial database with curl
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Barker committed Oct 3, 2012
1 parent 64ae378 commit 98dd8a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chttpd_db.erl
Expand Up @@ -171,8 +171,11 @@ create_db_req(#httpd{}=Req, DbName) ->
couch_httpd:verify_is_server_admin(Req),
N = couch_httpd:qs_value(Req, "n", couch_config:get("cluster", "n", "3")),
Q = couch_httpd:qs_value(Req, "q", couch_config:get("cluster", "q", "8")),
H = ?l2b(couch_httpd:qs_value(Req, "hash", "crc32hash")),
S = list_to_integer(couch_httpd:qs_value(Req, "size", "32")),

DocUrl = absolute_uri(Req, "/" ++ couch_util:url_encode(DbName)),
case fabric:create_db(DbName, [{n,N}, {q,Q}]) of
case fabric:create_db(DbName, [{n,N}, {q,Q}, {hash, H}, {size, S}]) of
ok ->
send_json(Req, 201, [{"Location", DocUrl}], {[{ok, true}]});
accepted ->
Expand Down

0 comments on commit 98dd8a2

Please sign in to comment.