aboutsummaryrefslogtreecommitdiffstats
path: root/examples/echo_post
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_post')
-rw-r--r--examples/echo_post/src/echo_post.erl1
-rw-r--r--examples/echo_post/src/echo_post_app.erl7
-rwxr-xr-xexamples/echo_post/start.sh2
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/echo_post/src/echo_post.erl b/examples/echo_post/src/echo_post.erl
index 0073a80..9c47b9c 100644
--- a/examples/echo_post/src/echo_post.erl
+++ b/examples/echo_post/src/echo_post.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(echo_post).
diff --git a/examples/echo_post/src/echo_post_app.erl b/examples/echo_post/src/echo_post_app.erl
index bb74d4a..93f3bd5 100644
--- a/examples/echo_post/src/echo_post_app.erl
+++ b/examples/echo_post/src/echo_post_app.erl
@@ -16,10 +16,9 @@ start(_Type, _Args) ->
{[], toppage_handler, []}
]}
],
- {ok, _} = cowboy:start_listener(http, 100,
- cowboy_tcp_transport, [{port, 8080}],
- cowboy_http_protocol, [{dispatch, Dispatch}]
- ),
+ {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [
+ {dispatch, Dispatch}
+ ]),
echo_post_sup:start_link().
stop(_State) ->
diff --git a/examples/echo_post/start.sh b/examples/echo_post/start.sh
index 4359abe..8444136 100755
--- a/examples/echo_post/start.sh
+++ b/examples/echo_post/start.sh
@@ -1,3 +1,3 @@
#!/bin/sh
erl -pa ebin deps/*/ebin -s echo_post \
- -eval "io:format(\"Run ./curl_post.sh STRING_TO_ECHO\")."
+ -eval "io:format(\"Run ./curl_post.sh STRING_TO_ECHO~n\")."