aboutsummaryrefslogtreecommitdiffstats
path: root/examples/echo_get
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_get')
-rw-r--r--examples/echo_get/src/toppage_handler.erl6
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/echo_get/src/toppage_handler.erl b/examples/echo_get/src/toppage_handler.erl
index be657c6..a7c8d7f 100644
--- a/examples/echo_get/src/toppage_handler.erl
+++ b/examples/echo_get/src/toppage_handler.erl
@@ -4,16 +4,12 @@
-module(toppage_handler).
-export([init/2]).
--export([handle/2]).
init(Req, Opts) ->
- {http, Req, Opts}.
-
-handle(Req, State) ->
Method = cowboy_req:method(Req),
#{echo := Echo} = cowboy_req:match_qs(Req, [echo]),
Req2 = echo(Method, Echo, Req),
- {ok, Req2, State}.
+ {ok, Req2, Opts}.
echo(<<"GET">>, undefined, Req) ->
cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req);