0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Fix static handler snippet in the guide

Thanks to Martin Törnwall for pointing this out.
This commit is contained in:
Loïc Hoguin 2013-04-11 23:26:16 +02:00
parent 2a98ae05e3
commit 5b9404fd07

View file

@ -19,14 +19,14 @@ Static handlers are pre-written REST handlers. They only need
to be specified in the routing information with the proper options. to be specified in the routing information with the proper options.
The following example routing serves all files found in the The following example routing serves all files found in the
`priv_dir/static/` directory of the application. It uses a `priv_dir/static/` directory of the application `my_app`. It uses
mimetypes library to figure out the files' content types. a mimetypes library to figure out the files' content types.
``` erlang ``` erlang
Dispatch = [ Dispatch = [
{'_', [ {'_', [
{"/[...]", cowboy_static, [ {"/[...]", cowboy_static, [
{directory, {priv_dir, static, []}}, {directory, {priv_dir, my_app, [<<"static">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}} {mimetypes, {fun mimetypes:path_to_mimes/2, default}}
]} ]}
]} ]}