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:
parent
413196ace1
commit
3c198f7d90
3 changed files with 141 additions and 8 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue