Open lpisces opened 10 years ago
mod_restful:
api:
- path: ["admin"]
module: mod_restful_admin
params:
key: "secret"
allowed_commands: [register, unregister]
- path: ["register"]
module: mod_restful_register
params:
key: "secret"
Could you please help me with the listener configuration in yaml as well?
@zhangzhang, here you go:
listen:
-
port: 8088
ip: "::"
module: ejabberd_http
request_handlers:
"/api": mod_restful
Proposed YAML configuration is not working for me, any ideas?
2015-09-11 02:27:16.367 [critical] <0.37.0>@gen_mod:start_module:107 Problem starting the module mod_restful for host <<"fernando">>
options: [{api,[[{path,[<<"admin">>]},
{module,mod_restful_admin},
{params,[{key,<<"secret">>},
{allowed_commands,[register,unregister]}]}],
[{path,[<<"register">>]},
{module,mod_restful_register},
{params,[{key,<<"secret">>}]}]]}]
error: undef
[{mod_restful,start,
[<<"fernando">>,
[{api,[[{path,[<<"admin">>]},
{module,mod_restful_admin},
{params,[{key,<<"secret">>},
{allowed_commands,[register,unregister]}]}],
[{path,[<<"register">>]},
{module,mod_restful_register},
{params,[{key,<<"secret">>}]}]]}]],
[]},
{gen_mod,start_module,3,[{file,"src/gen_mod.erl"},{line,99}]},
{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},
{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,72}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,272}]}]
2015-09-11 02:27:16.368 [critical] <0.37.0>@gen_mod:start_module:112 ejabberd initialization was aborted because a module start failed.
@lwxfer Could it be that ejabberd can't find your compiled .beam files?
Worked pretty fine, but I had to change ip to 0.0.0.0
listen:
-
port: 8088
ip: "0.0.0.0"
module: ejabberd_http
request_handlers:
"/api": mod_restful
thank you ~