aboutsummaryrefslogtreecommitdiffstats
path: root/examples/compress_response/src/toppage_handler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/compress_response/src/toppage_handler.erl')
-rw-r--r--examples/compress_response/src/toppage_handler.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/compress_response/src/toppage_handler.erl b/examples/compress_response/src/toppage_handler.erl
index 7c1569a..09c8689 100644
--- a/examples/compress_response/src/toppage_handler.erl
+++ b/examples/compress_response/src/toppage_handler.erl
@@ -3,12 +3,11 @@
%% @doc Compress response handler.
-module(toppage_handler).
--export([init/3]).
+-export([init/2]).
-export([handle/2]).
--export([terminate/3]).
-init(_Transport, Req, []) ->
- {ok, Req, undefined}.
+init(Req, Opts) ->
+ {http, Req, Opts}.
handle(Req, State) ->
BigBody =
@@ -26,6 +25,3 @@ in many other parts of the world, particularly South America and Australia,
who perform work similar to the cowboy in their respective nations.\n">>,
Req2 = cowboy_req:reply(200, [], BigBody, Req),
{ok, Req2, State}.
-
-terminate(_Reason, _Req, _State) ->
- ok.