[erlang-questions] cowboy throwing a routing error

Wes James comptekki@REDACTED
Thu Jan 10 16:43:43 CET 2013


Like this....

{ok, _} =
        cowboy:start_http(
          http,
          100,
          [{port, HTTP_Port}],
          [{env, [{dispatch, Dispatch}]}]
         )

wes


On Thu, Jan 10, 2013 at 7:11 AM, AD <straightflush@REDACTED> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130110/c6e10a0c/attachment.htm>


More information about the erlang-questions mailing list