diff options
Diffstat (limited to 'examples/echo_get/src')
-rw-r--r-- | examples/echo_get/src/echo_get_app.erl | 6 | ||||
-rw-r--r-- | examples/echo_get/src/toppage_handler.erl | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/echo_get/src/echo_get_app.erl b/examples/echo_get/src/echo_get_app.erl index d661e9c..b9e0d31 100644 --- a/examples/echo_get/src/echo_get_app.erl +++ b/examples/echo_get/src/echo_get_app.erl @@ -16,9 +16,9 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [ - {env, [{dispatch, Dispatch}]} - ]), + {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + env => #{dispatch => Dispatch} + }), echo_get_sup:start_link(). stop(_State) -> diff --git a/examples/echo_get/src/toppage_handler.erl b/examples/echo_get/src/toppage_handler.erl index 800284e..92762e8 100644 --- a/examples/echo_get/src/toppage_handler.erl +++ b/examples/echo_get/src/toppage_handler.erl @@ -14,9 +14,9 @@ init(Req, Opts) -> echo(<<"GET">>, undefined, Req) -> cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req); echo(<<"GET">>, Echo, Req) -> - cowboy_req:reply(200, [ - {<<"content-type">>, <<"text/plain; charset=utf-8">>} - ], Echo, Req); + cowboy_req:reply(200, #{ + <<"content-type">> => <<"text/plain; charset=utf-8">> + }, Echo, Req); echo(_, _, Req) -> %% Method not allowed. cowboy_req:reply(405, Req). |