How to pass options?
joaohf opened this issue · comments
João Henrique Ferreira de Freitas commented
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.
Brujo Benavides commented
@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),
…