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

How to pass options? #56

Closed
joaohf opened this issue Feb 14, 2016 · 1 comment
Closed

How to pass options? #56

joaohf opened this issue Feb 14, 2016 · 1 comment

Comments

@joaohf
Copy link

joaohf commented Feb 14, 2016

Hi,

Using cowboy, withou cowboy-swagger I used to pass an Option to cowboy handlers. Like this:

 Opts = get_handler_options(HttpConfig),
Dispatch = cowboy_router:compile([
                                      {'_', [ {"/nodes/[:type]", location, Opts},
....

How to achieve the same using trails ?

Thanks.

@elbrujohalcon
Copy link
Member

@joaohf you have to add those options to each trail, like this:

Opts = get_handler_options(HttpConfig),
Trails = [trails:trail("/nodes/[:type]", location, Opts)],
Dispatch = trails:single_host_compile(Trails),
…

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

2 participants