Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you offer a yaml config example? #19

Open
lpisces opened this issue Apr 27, 2014 · 6 comments
Open

can you offer a yaml config example? #19

lpisces opened this issue Apr 27, 2014 · 6 comments

Comments

@lpisces
Copy link

lpisces commented Apr 27, 2014

thank you ~

@jadahl
Copy link
Owner

jadahl commented Apr 28, 2014

  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"

@zhangzhang
Copy link

Could you please help me with the listener configuration in yaml as well?

@jadahl
Copy link
Owner

jadahl commented Nov 8, 2014

@zhangzhang, here you go:

listen:
  -
    port: 8088
    ip: "::"
    module: ejabberd_http
    request_handlers:
      "/api": mod_restful

@zxcfer
Copy link

zxcfer commented Sep 11, 2015

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.

@jadahl
Copy link
Owner

jadahl commented Sep 11, 2015

@lwxfer Could it be that ejabberd can't find your compiled .beam files?

@zxcfer
Copy link

zxcfer commented Sep 11, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants