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

Fix and update the compress example to use cowboy_compress_h

This commit is contained in:
Loïc Hoguin 2017-01-22 20:17:52 +01:00
parent 413196ace1
commit 3c198f7d90
No known key found for this signature in database
GPG key ID: 71366FF21851DF03
3 changed files with 141 additions and 8 deletions

View file

@ -16,10 +16,10 @@ start(_Type, _Args) ->
{"/", toppage_handler, []}
]}
]),
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [
{compress, true},
{env, [{dispatch, Dispatch}]}
]),
{ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{
env => #{dispatch => Dispatch},
stream_handlers => [cowboy_compress_h, cowboy_stream_h]
}),
compress_response_sup:start_link().
stop(_State) ->