From b7f7713faefeab6f45994c0c940497b1c3ee7619 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 18 Aug 2021 13:39:17 +0200 Subject: Add example config to mod_http_api documentation --- src/mod_http_api.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mod_http_api.erl') diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 0a3942024..0f494bb3a 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -533,4 +533,14 @@ mod_doc() -> "in the request_handlers, add a 'vN'. " "For example: '/api/v2: mod_http_api'"), "", ?T("To run a command, send a POST request to the corresponding " - "URL: 'http://localhost:5280/api/'")]}. + "URL: 'http://localhost:5280/api/'")], + example => + ["listen:", + " -", + " port: 5280", + " module: ejabberd_http", + " request_handlers:", + " /api: mod_http_api", + "", + "modules:", + " mod_http_api: {}"]}. -- cgit v1.2.3 From 30ae66e99e4a7499886436b195311ff012f09fda Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 23 Aug 2021 13:40:19 +0200 Subject: Improve formatting and add sections links --- src/mod_http_api.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mod_http_api.erl') diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 0f494bb3a..427833584 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -527,8 +527,8 @@ mod_doc() -> [?T("This module provides a ReST API to call ejabberd commands " "using JSON data."), "", ?T("To use this module, in addition to adding it to the 'modules' " - "section, you must also add it to 'request_handlers' of some " - "listener."), "", + "section, you must also enable it in 'listen' -> 'ejabberd_http' -> " + "http://../listen-options/#request-handlers[request_handlers]."), "", ?T("To use a specific API version N, when defining the URL path " "in the request_handlers, add a 'vN'. " "For example: '/api/v2: mod_http_api'"), "", -- cgit v1.2.3