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:
parent
6a90d00cee
commit
834056402a
9 changed files with 35 additions and 62 deletions
|
@ -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">>]}]}
|
||||
]}
|
||||
]}
|
||||
]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue