Skip to content

Instantly share code, notes, and snippets.

@fishcakez
Forked from ruslander/gist:4950210
Created February 14, 2013 02:59
Show Gist options
  • Save fishcakez/4950267 to your computer and use it in GitHub Desktop.
Save fishcakez/4950267 to your computer and use it in GitHub Desktop.
Dispatch = cowboy_router:compile([
{'_', [
{"/", cowboy_static,
[{directory, {priv_dir, web, []}},
{mimetypes, [{<<".html">>, [<<"text/html">>]}]},
{file, <<"index.html">>}]},
{"/js/[...]", cowboy_static,
[{directory, {priv_dir, web, [<<"js">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
{"/css/[...]", cowboy_static,
[{directory, {priv_dir, web, [<<"css">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
{"/img/[...]", cowboy_static,
[{directory, {priv_dir, web, [<<"img">>]}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
{"/[...]", cowboy_static, [
{directory, {priv_dir, web, []}},
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}
]}
]}
]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment