From e2b11bbeedc0f7114910bb04bcb842d25e789427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 7 Sep 2013 22:26:40 +0200 Subject: Convert the GET echo example to a release --- examples/echo_get/src/echo_get.erl | 15 --------------- examples/echo_get/src/toppage_handler.erl | 5 +++-- 2 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 examples/echo_get/src/echo_get.erl (limited to 'examples/echo_get/src') diff --git a/examples/echo_get/src/echo_get.erl b/examples/echo_get/src/echo_get.erl deleted file mode 100644 index 9b1307d..0000000 --- a/examples/echo_get/src/echo_get.erl +++ /dev/null @@ -1,15 +0,0 @@ -%% Feel free to use, reuse and abuse the code in this file. - --module(echo_get). - -%% API. --export([start/0]). - -%% API. - -start() -> - ok = application:start(crypto), - ok = application:start(cowlib), - ok = application:start(ranch), - ok = application:start(cowboy), - ok = application:start(echo_get). diff --git a/examples/echo_get/src/toppage_handler.erl b/examples/echo_get/src/toppage_handler.erl index c604bae..1187dc6 100644 --- a/examples/echo_get/src/toppage_handler.erl +++ b/examples/echo_get/src/toppage_handler.erl @@ -19,8 +19,9 @@ handle(Req, State) -> echo(<<"GET">>, undefined, Req) -> cowboy_req:reply(400, [], <<"Missing echo parameter.">>, Req); echo(<<"GET">>, Echo, Req) -> - cowboy_req:reply(200, - [{<<"content-encoding">>, <<"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). -- cgit v1.2.3