mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Improve Websocket example
This commit is contained in:
parent
efbd913326
commit
574c3d4900
5 changed files with 14 additions and 4 deletions
|
@ -13,7 +13,11 @@ start(_Type, _Args) ->
|
|||
Dispatch = cowboy_router:compile([
|
||||
{'_', [
|
||||
{"/", toppage_handler, []},
|
||||
{"/websocket", ws_handler, []}
|
||||
{"/websocket", ws_handler, []},
|
||||
{"/static/[...]", cowboy_static, [
|
||||
{directory, {priv_dir, websocket, [<<"static">>]}},
|
||||
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}
|
||||
]}
|
||||
]}
|
||||
]),
|
||||
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue