From ff936ff0ee62731d54ec35335355f76577044443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 30 Apr 2016 14:41:10 +0200 Subject: Fix hello_world example --- examples/hello_world/src/hello_world_app.erl | 6 +++--- examples/hello_world/src/toppage_handler.erl | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/hello_world/src/hello_world_app.erl b/examples/hello_world/src/hello_world_app.erl index eb938d3..0e4438b 100644 --- a/examples/hello_world/src/hello_world_app.erl +++ b/examples/hello_world/src/hello_world_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} + }), hello_world_sup:start_link(). stop(_State) -> diff --git a/examples/hello_world/src/toppage_handler.erl b/examples/hello_world/src/toppage_handler.erl index e8e672e..eb95bf3 100644 --- a/examples/hello_world/src/toppage_handler.erl +++ b/examples/hello_world/src/toppage_handler.erl @@ -6,7 +6,7 @@ -export([init/2]). init(Req, Opts) -> - Req2 = cowboy_req:reply(200, [ - {<<"content-type">>, <<"text/plain">>} - ], <<"Hello world!">>, Req), - {ok, Req2, Opts}. + cowboy_req:reply(200, #{ + <<"content-type">> => <<"text/plain">> + }, <<"Hello world!">>, Req), + {ok, Req, Opts}. -- cgit v1.2.3