aboutsummaryrefslogtreecommitdiffstats
path: root/examples/chunked_hello_world/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/chunked_hello_world/src')
-rw-r--r--examples/chunked_hello_world/src/toppage_handler.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/chunked_hello_world/src/toppage_handler.erl b/examples/chunked_hello_world/src/toppage_handler.erl
index 4e6b4e4..6b47156 100644
--- a/examples/chunked_hello_world/src/toppage_handler.erl
+++ b/examples/chunked_hello_world/src/toppage_handler.erl
@@ -3,12 +3,11 @@
%% @doc Chunked hello world 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) ->
Req2 = cowboy_req:chunked_reply(200, Req),
@@ -18,6 +17,3 @@ handle(Req, State) ->
timer:sleep(1000),
cowboy_req:chunk("Chunked!\r\n", Req2),
{ok, Req2, State}.
-
-terminate(_Reason, _Req, _State) ->
- ok.