diff options
-rw-r--r-- | examples/README.md | 4 | ||||
-rw-r--r-- | examples/static_world/README.md (renamed from examples/static/README.md) | 2 | ||||
-rw-r--r-- | examples/static_world/priv/small.mp4 (renamed from examples/static/priv/small.mp4) | bin | 383631 -> 383631 bytes | |||
-rw-r--r-- | examples/static_world/priv/small.ogv (renamed from examples/static/priv/small.ogv) | bin | 872453 -> 872453 bytes | |||
-rw-r--r-- | examples/static_world/priv/test.txt (renamed from examples/static/priv/test.txt) | 0 | ||||
-rw-r--r-- | examples/static_world/priv/video.html (renamed from examples/static/priv/video.html) | 0 | ||||
-rw-r--r-- | examples/static_world/rebar.config (renamed from examples/static/rebar.config) | 0 | ||||
-rw-r--r-- | examples/static_world/src/static_world.app.src (renamed from examples/static/src/static.app.src) | 6 | ||||
-rw-r--r-- | examples/static_world/src/static_world.erl (renamed from examples/static/src/static.erl) | 4 | ||||
-rw-r--r-- | examples/static_world/src/static_world_app.erl (renamed from examples/static/src/static_app.erl) | 6 | ||||
-rw-r--r-- | examples/static_world/src/static_world_sup.erl (renamed from examples/static/src/static_sup.erl) | 2 | ||||
-rwxr-xr-x | examples/static_world/start.sh (renamed from examples/static/start.sh) | 2 |
12 files changed, 13 insertions, 13 deletions
diff --git a/examples/README.md b/examples/README.md index 3ba7c5b..10a2b86 100644 --- a/examples/README.md +++ b/examples/README.md @@ -25,8 +25,8 @@ Cowboy Examples * [rest_hello_world](./examples/rest_hello_world): return the data type that matches the request type (ex: html, text, json) - * [static](./examples/static): - an example file server + * [static_world](./examples/static_world): + static file handler * [websocket](./examples/websocket): websocket example diff --git a/examples/static/README.md b/examples/static_world/README.md index 78f5338..e947ebb 100644 --- a/examples/static/README.md +++ b/examples/static_world/README.md @@ -1,4 +1,4 @@ -Cowboy Static Files Server +Cowboy Static File Handler ========================== To compile this example you need rebar in your PATH. diff --git a/examples/static/priv/small.mp4 b/examples/static_world/priv/small.mp4 Binary files differindex 1fc4788..1fc4788 100644 --- a/examples/static/priv/small.mp4 +++ b/examples/static_world/priv/small.mp4 diff --git a/examples/static/priv/small.ogv b/examples/static_world/priv/small.ogv Binary files differindex 6409d6e..6409d6e 100644 --- a/examples/static/priv/small.ogv +++ b/examples/static_world/priv/small.ogv diff --git a/examples/static/priv/test.txt b/examples/static_world/priv/test.txt index 760cddb..760cddb 100644 --- a/examples/static/priv/test.txt +++ b/examples/static_world/priv/test.txt diff --git a/examples/static/priv/video.html b/examples/static_world/priv/video.html index eca63ee..eca63ee 100644 --- a/examples/static/priv/video.html +++ b/examples/static_world/priv/video.html diff --git a/examples/static/rebar.config b/examples/static_world/rebar.config index eb6f194..eb6f194 100644 --- a/examples/static/rebar.config +++ b/examples/static_world/rebar.config diff --git a/examples/static/src/static.app.src b/examples/static_world/src/static_world.app.src index bf7512d..b65995d 100644 --- a/examples/static/src/static.app.src +++ b/examples/static_world/src/static_world.app.src @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. -{application, static, [ - {description, "Cowboy static file server example."}, +{application, static_world, [ + {description, "Cowboy static file handler example."}, {vsn, "1"}, {modules, []}, {registered, []}, @@ -10,6 +10,6 @@ stdlib, cowboy ]}, - {mod, {static_app, []}}, + {mod, {static_world_app, []}}, {env, []} ]}. diff --git a/examples/static/src/static.erl b/examples/static_world/src/static_world.erl index d3eb319..6425a99 100644 --- a/examples/static/src/static.erl +++ b/examples/static_world/src/static_world.erl @@ -1,6 +1,6 @@ %% Feel free to use, reuse and abuse the code in this file. --module(static). +-module(static_world). %% API. -export([start/0]). @@ -11,4 +11,4 @@ start() -> ok = application:start(crypto), ok = application:start(ranch), ok = application:start(cowboy), - ok = application:start(static). + ok = application:start(static_world). diff --git a/examples/static/src/static_app.erl b/examples/static_world/src/static_world_app.erl index a2b9c31..6470f12 100644 --- a/examples/static/src/static_app.erl +++ b/examples/static_world/src/static_world_app.erl @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. %% @private --module(static_app). +-module(static_world_app). -behaviour(application). %% API. @@ -14,7 +14,7 @@ start(_Type, _Args) -> Dispatch = cowboy_router:compile([ {'_', [ {"/[...]", cowboy_static, [ - {directory, {priv_dir, static, []}}, + {directory, {priv_dir, static_world, []}}, {mimetypes, {fun mimetypes:path_to_mimes/2, default}} ]} ]} @@ -22,7 +22,7 @@ start(_Type, _Args) -> {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [ {env, [{dispatch, Dispatch}]} ]), - static_sup:start_link(). + static_world_sup:start_link(). stop(_State) -> ok. diff --git a/examples/static/src/static_sup.erl b/examples/static_world/src/static_world_sup.erl index a3b2e16..a57d07a 100644 --- a/examples/static/src/static_sup.erl +++ b/examples/static_world/src/static_world_sup.erl @@ -1,7 +1,7 @@ %% Feel free to use, reuse and abuse the code in this file. %% @private --module(static_sup). +-module(static_world_sup). -behaviour(supervisor). %% API. diff --git a/examples/static/start.sh b/examples/static_world/start.sh index bc67846..995f913 100755 --- a/examples/static/start.sh +++ b/examples/static_world/start.sh @@ -1,4 +1,4 @@ #!/bin/sh -erl -pa ebin deps/*/ebin -s static \ +erl -pa ebin deps/*/ebin -s static_world \ -eval "io:format(\"Point your browser at http://localhost:8080/test.txt~n\")." \ -eval "io:format(\"Point your browser at http://localhost:8080/video.html~n\")." |