Skip to content

Commit

Permalink
Modified static example to send appropriate MIME type
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbmercer authored and essen committed Oct 11, 2012
1 parent 1f9d71c commit b5fdf02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/static/rebar.config
@@ -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"}}
]}.
3 changes: 2 additions & 1 deletion examples/static/src/static_app.erl
Expand Up @@ -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}}
]}
]}
],
Expand Down

0 comments on commit b5fdf02

Please sign in to comment.