aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-08-27 11:50:35 +0200
committerLoïc Hoguin <[email protected]>2012-08-27 11:50:35 +0200
commite4124de2c71564d37b3732ede0fe1542de1d6f99 (patch)
tree0e632d9eb44c848bfc4b9190251e7c8566c8debc /examples
parent50e5a616dcaa765f0c795f565d361196823ed2fe (diff)
downloadcowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.tar.gz
cowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.tar.bz2
cowboy-e4124de2c71564d37b3732ede0fe1542de1d6f99.zip
Switch to Ranch for connection handling
This is the first of many API incompatible changes. You have been warned.
Diffstat (limited to 'examples')
-rw-r--r--examples/chunked_hello_world/src/chunked_hello_world.erl1
-rw-r--r--examples/chunked_hello_world/src/chunked_hello_world_app.erl7
-rw-r--r--examples/echo_get/src/echo_get.erl1
-rw-r--r--examples/echo_get/src/echo_get_app.erl7
-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
-rw-r--r--examples/hello_world/src/hello_world.erl1
-rw-r--r--examples/hello_world/src/hello_world_app.erl7
-rw-r--r--examples/rest_hello_world/src/rest_hello_world.erl1
-rw-r--r--examples/rest_hello_world/src/rest_hello_world_app.erl7
-rw-r--r--examples/static/src/static.erl1
-rw-r--r--examples/static/src/static_app.erl7
13 files changed, 25 insertions, 25 deletions
diff --git a/examples/chunked_hello_world/src/chunked_hello_world.erl b/examples/chunked_hello_world/src/chunked_hello_world.erl
index 5f3ddf8..5c13f0e 100644
--- a/examples/chunked_hello_world/src/chunked_hello_world.erl
+++ b/examples/chunked_hello_world/src/chunked_hello_world.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(chunked_hello_world).
diff --git a/examples/chunked_hello_world/src/chunked_hello_world_app.erl b/examples/chunked_hello_world/src/chunked_hello_world_app.erl
index 0fc1b8b..41efd06 100644
--- a/examples/chunked_hello_world/src/chunked_hello_world_app.erl
+++ b/examples/chunked_hello_world/src/chunked_hello_world_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}
+ ]),
chunked_hello_world_sup:start_link().
stop(_State) ->
diff --git a/examples/echo_get/src/echo_get.erl b/examples/echo_get/src/echo_get.erl
index 81d0f43..a8f8956 100644
--- a/examples/echo_get/src/echo_get.erl
+++ b/examples/echo_get/src/echo_get.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(echo_get).
diff --git a/examples/echo_get/src/echo_get_app.erl b/examples/echo_get/src/echo_get_app.erl
index 8220bd3..b9551f0 100644
--- a/examples/echo_get/src/echo_get_app.erl
+++ b/examples/echo_get/src/echo_get_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_get_sup:start_link().
stop(_State) ->
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\")."
diff --git a/examples/hello_world/src/hello_world.erl b/examples/hello_world/src/hello_world.erl
index 2f0ae6b..301c6d2 100644
--- a/examples/hello_world/src/hello_world.erl
+++ b/examples/hello_world/src/hello_world.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(hello_world).
diff --git a/examples/hello_world/src/hello_world_app.erl b/examples/hello_world/src/hello_world_app.erl
index 03f3e6e..1cb15ab 100644
--- a/examples/hello_world/src/hello_world_app.erl
+++ b/examples/hello_world/src/hello_world_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}
+ ]),
hello_world_sup:start_link().
stop(_State) ->
diff --git a/examples/rest_hello_world/src/rest_hello_world.erl b/examples/rest_hello_world/src/rest_hello_world.erl
index 7a63e41..bdd24cc 100644
--- a/examples/rest_hello_world/src/rest_hello_world.erl
+++ b/examples/rest_hello_world/src/rest_hello_world.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(rest_hello_world).
diff --git a/examples/rest_hello_world/src/rest_hello_world_app.erl b/examples/rest_hello_world/src/rest_hello_world_app.erl
index 01560f0..510dbb1 100644
--- a/examples/rest_hello_world/src/rest_hello_world_app.erl
+++ b/examples/rest_hello_world/src/rest_hello_world_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}
+ ]),
rest_hello_world_sup:start_link().
stop(_State) ->
diff --git a/examples/static/src/static.erl b/examples/static/src/static.erl
index a542adb..c3f4035 100644
--- a/examples/static/src/static.erl
+++ b/examples/static/src/static.erl
@@ -8,5 +8,6 @@
%% API.
start() ->
+ ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(static).
diff --git a/examples/static/src/static_app.erl b/examples/static/src/static_app.erl
index 3fba707..b919c27 100644
--- a/examples/static/src/static_app.erl
+++ b/examples/static/src/static_app.erl
@@ -18,10 +18,9 @@ start(_Type, _Args) ->
]}
]}
],
- {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}
+ ]),
static_sup:start_link().
stop(_State) ->