Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The patch below allows to configure vendor and module version information into the GET / welcome message.
E.g.
[vendor]
name = refuge
version = 2.0.0
[modules]
geocouch = 1.2.1
would produce:
{"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geocouch":"1.2.1"}}
–
— a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -30,9 +30,23 @@
% httpd global handlers
handle_welcome_req(#httpd
{method='GET'}=Req, WelcomeMessage) ->
+ Vendor = case couch_config:get("vendor") of
+ [] -> [];
+ Vendor1 -> [
]
+ end,
+
+ Modules = lists:map(fun(
) ->
+
+ end, couch_config:get("modules")),
+
send_json(Req, {[
,
- {version, list_to_binary(couch_server:get_version())}
+
{version, list_to_binary(couch_server:get_version())}]
+ ++ Vendor
+ ++ [{modules, {Modules}}
]});
handle_welcome_req(Req, _) ->
send_method_not_allowed(Req, "GET,HEAD").