diff options
author | Loïc Hoguin <[email protected]> | 2013-09-09 15:51:41 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-09-09 15:51:41 +0200 |
commit | 28f90b81fa25ebba578bc1b449ddf66d1a82ea3e (patch) | |
tree | c46e6860cbebd73fa4dbff0551409585d3bcff73 /examples/static_world/src | |
parent | 24a22fa657af8398c963889d0bf08a904c96ec8c (diff) | |
download | cowboy-28f90b81fa25ebba578bc1b449ddf66d1a82ea3e.tar.gz cowboy-28f90b81fa25ebba578bc1b449ddf66d1a82ea3e.tar.bz2 cowboy-28f90b81fa25ebba578bc1b449ddf66d1a82ea3e.zip |
Convert the static handler example to a release
Temporarily hardcode the list of mimetypes.
Diffstat (limited to 'examples/static_world/src')
-rw-r--r-- | examples/static_world/src/static_world.erl | 15 | ||||
-rw-r--r-- | examples/static_world/src/static_world_app.erl | 7 |
2 files changed, 6 insertions, 16 deletions
diff --git a/examples/static_world/src/static_world.erl b/examples/static_world/src/static_world.erl deleted file mode 100644 index 2bed337..0000000 --- a/examples/static_world/src/static_world.erl +++ /dev/null @@ -1,15 +0,0 @@ -%% Feel free to use, reuse and abuse the code in this file. - --module(static_world). - -%% 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(static_world). diff --git a/examples/static_world/src/static_world_app.erl b/examples/static_world/src/static_world_app.erl index 6470f12..4cc0254 100644 --- a/examples/static_world/src/static_world_app.erl +++ b/examples/static_world/src/static_world_app.erl @@ -15,7 +15,12 @@ start(_Type, _Args) -> {'_', [ {"/[...]", cowboy_static, [ {directory, {priv_dir, static_world, []}}, - {mimetypes, {fun mimetypes:path_to_mimes/2, default}} + {mimetypes, [ + {<<".html">>, [<<"text/html">>]}, + {<<".txt">>, [<<"text/plain">>]}, + {<<".mp4">>, [<<"video/mp4">>]}, + {<<".ogv">>, [<<"video/ogg">>]} + ]} ]} ]} ]), |