aboutsummaryrefslogtreecommitdiffstats
path: root/examples/echo_post/src/toppage_handler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_post/src/toppage_handler.erl')
-rw-r--r--examples/echo_post/src/toppage_handler.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/echo_post/src/toppage_handler.erl b/examples/echo_post/src/toppage_handler.erl
index de1f2ad..2bafed0 100644
--- a/examples/echo_post/src/toppage_handler.erl
+++ b/examples/echo_post/src/toppage_handler.erl
@@ -3,12 +3,11 @@
%% @doc POST 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),
@@ -32,6 +31,3 @@ echo(Echo, Req) ->
cowboy_req:reply(200, [
{<<"content-type">>, <<"text/plain; charset=utf-8">>}
], Echo, Req).
-
-terminate(_Reason, _Req, _State) ->
- ok.