aboutsummaryrefslogtreecommitdiffstats
path: root/examples/compress_response/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/compress_response/src')
-rw-r--r--examples/compress_response/src/compress_response_app.erl8
-rw-r--r--examples/compress_response/src/toppage_handler.erl2
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/compress_response/src/compress_response_app.erl b/examples/compress_response/src/compress_response_app.erl
index b36dcbd..aed2e69 100644
--- a/examples/compress_response/src/compress_response_app.erl
+++ b/examples/compress_response/src/compress_response_app.erl
@@ -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) ->
diff --git a/examples/compress_response/src/toppage_handler.erl b/examples/compress_response/src/toppage_handler.erl
index 35a3b9c..67b8fea 100644
--- a/examples/compress_response/src/toppage_handler.erl
+++ b/examples/compress_response/src/toppage_handler.erl
@@ -19,5 +19,5 @@ have established the ability to work at virtually identical tasks and obtained
considerable respect for their achievements. There are also cattle handlers
in many other parts of the world, particularly South America and Australia,
who perform work similar to the cowboy in their respective nations.\n">>,
- Req = cowboy_req:reply(200, [], BigBody, Req0),
+ Req = cowboy_req:reply(200, #{}, BigBody, Req0),
{ok, Req, Opts}.