Skip to content

Commit

Permalink
update cowboy_test_server.erl to cowboy 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gebi committed May 10, 2013
1 parent 0cf6e83 commit 1b0a63f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions examples/cowboy_test_server.erl
Expand Up @@ -32,22 +32,23 @@ main(_) ->
<<"/cookie_needed_echo">>, fun service_echo/3, state,
[{cookie_needed, true}]),

VRoutes = [{[<<"echo">>, '...'], sockjs_cowboy_handler, StateEcho},
{[<<"close">>, '...'], sockjs_cowboy_handler, StateClose},
{[<<"amplify">>, '...'], sockjs_cowboy_handler, StateAmplify},
{[<<"broadcast">>, '...'], sockjs_cowboy_handler, StateBroadcast},
{[<<"disabled_websocket_echo">>, '...'], sockjs_cowboy_handler,
VRoutes = [{<<"/echo/[...]">>, sockjs_cowboy_handler, StateEcho},
{<<"/close/[...]">>, sockjs_cowboy_handler, StateClose},
{<<"/amplify/[...]">>, sockjs_cowboy_handler, StateAmplify},
{<<"/broadcast/[...]">>, sockjs_cowboy_handler, StateBroadcast},
{<<"/disabled_websocket_echo/[...]">>, sockjs_cowboy_handler,
StateDWSEcho},
{[<<"cookie_needed_echo">>, '...'], sockjs_cowboy_handler,
{<<"/cookie_needed_echo/[...]">>, sockjs_cowboy_handler,
StateCNEcho},
{'_', ?MODULE, []}],
Routes = [{'_', VRoutes}], % any vhost
Dispatch = cowboy_router:compile(Routes),

io:format(" [*] Running at http://localhost:~p~n", [Port]),

cowboy:start_http(cowboy_test_server_http_listener, 100,
[{port, Port}],
[{dispatch, Routes}]),
[{env, [{dispatch, Dispatch}]}]),
receive
_ -> ok
end.
Expand Down

0 comments on commit 1b0a63f

Please sign in to comment.