0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Modified static example to send appropriate MIME type

Modified the static example in the examples subdirectory
to use the mimetypes application to determine the appropriate
MIME type to send down the wire in the HTTP headers of the reply.
This commit is contained in:
dbmercer 2012-10-08 14:25:39 -05:00 committed by Loïc Hoguin
parent 1f9d71c3f5
commit b5fdf02af0
2 changed files with 5 additions and 2 deletions

View file

@ -1,4 +1,6 @@
{deps, [
{cowboy, ".*",
{git, "git://github.com/extend/cowboy.git", "master"}}
{git, "git://github.com/extend/cowboy.git", "master"}},
{mimetypes, ".*",
{git, "git://github.com/spawngrid/mimetypes.git", "master"}}
]}.

View file

@ -14,7 +14,8 @@ start(_Type, _Args) ->
Dispatch = [
{'_', [
{['...'], cowboy_static, [
{directory, {priv_dir, static, []}}
{directory, {priv_dir, static, []}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}
]}
]}
],