Browse Source

Rename example 'static' to 'static_world' to avoid confusion

Loïc Hoguin 12 years ago
parent
commit
f96e20aef7

+ 2 - 2
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

+ 1 - 1
examples/static/README.md → 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.

+ 0 - 0
examples/static/priv/small.mp4 → examples/static_world/priv/small.mp4


+ 0 - 0
examples/static/priv/small.ogv → examples/static_world/priv/small.ogv


+ 0 - 0
examples/static/priv/test.txt → examples/static_world/priv/test.txt


+ 0 - 0
examples/static/priv/video.html → examples/static_world/priv/video.html


+ 0 - 0
examples/static/rebar.config → examples/static_world/rebar.config


+ 3 - 3
examples/static/src/static.app.src → 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, []}
 ]}.

+ 2 - 2
examples/static/src/static.erl → 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).

+ 3 - 3
examples/static/src/static_app.erl → 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.

+ 1 - 1
examples/static/src/static_sup.erl → 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.

+ 1 - 1
examples/static/start.sh → 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\")."