[erlang-questions] cowboy throwing a routing error
Fred Hebert
mononcqc@REDACTED
Thu Jan 10 15:24:17 CET 2013
The latest cowboy now uses [{env, [{dispatch, Routes}]}] as its options
for the dispatching rather than the old format.
I got the same error yesterday and this fixed it. The documentation didn't
follow through with the changes, but that's what we get for using the
bleeding edge rather than tagged versions.
Regards,
Fred.
On 01/10, AD wrote:
> hello,
>
> Using sockjs and the latest cowboy/ranch, I am running into a badarg
> error with cowboy_router. Not sure what is causing this, i captured the
> debug info here in this gist
>
> https://gist.github.com/4502255
>
> I am starting like this
>
> SockjsState = sockjs_handler:init_state(<<"/socket">>,fun
> wsocket_handler/3, state, []),
>
> VRoutes = [{[<<"socket">>, '...'], sockjs_cowboy_handler, SockjsState},
>
> {'_', ?MODULE, []}],
> Routes = [{'_', VRoutes}],
>
> lager:info("Starting the cowboy listener on port ~p..~n",[?COWBOY_HTTP_PORT]),
>
> cowboy:start_http(my_http_listener, ?COWBOY_HTTP_ACCEPTORS, [{port,
> ?COWBOY_HTTP_PORT}], [{dispatch, Routes}]).
>
> But the call to lists:keyfind(dispatch, 1, Env) seems to be failing
> for some reason.
>
> Any ideas ?
>
> Thanks
> - AD
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list