aboutsummaryrefslogtreecommitdiffstats
path: root/examples/echo_get/src/toppage_handler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_get/src/toppage_handler.erl')
-rw-r--r--examples/echo_get/src/toppage_handler.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/echo_get/src/toppage_handler.erl b/examples/echo_get/src/toppage_handler.erl
index 50c5985..be657c6 100644
--- a/examples/echo_get/src/toppage_handler.erl
+++ b/examples/echo_get/src/toppage_handler.erl
@@ -3,12 +3,11 @@
%% @doc GET echo 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) ->
Method = cowboy_req:method(Req),
@@ -25,6 +24,3 @@ echo(<<"GET">>, Echo, Req) ->
echo(_, _, Req) ->
%% Method not allowed.
cowboy_req:reply(405, Req).
-
-terminate(_Reason, _Req, _State) ->
- ok.