0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Convert the websocket example to a release

This commit is contained in:
Loïc Hoguin 2013-09-09 16:21:53 +02:00
parent 6a90d00cee
commit 834056402a
9 changed files with 35 additions and 62 deletions

View file

@ -12,11 +12,15 @@
start(_Type, _Args) ->
Dispatch = cowboy_router:compile([
{'_', [
{"/", toppage_handler, []},
{"/", cowboy_static, [
{directory, {priv_dir, websocket, []}},
{file, <<"index.html">>},
{mimetypes, [{<<".html">>, [<<"text/html">>]}]}
]},
{"/websocket", ws_handler, []},
{"/static/[...]", cowboy_static, [
{directory, {priv_dir, websocket, [<<"static">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}
{mimetypes, [{<<".js">>, [<<"application/javascript">>]}]}
]}
]}
]),