Created
July 12, 2012 18:04
-
-
Save presci/3099759 to your computer and use it in GitHub Desktop.
cowboy dispatcher config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dispatch=[ | |
{'_', [ | |
{[<<"static">>, '...'], cowboy_http_static, | |
[{directory, "./priv"}, | |
{mimetypes, [ | |
{<<".css">>, [<<"text/css">>]}, | |
{<<".js">>, [<<"application/javascript">>]}, | |
{<<".html">>, [<<"text/html">>]} | |
]} | |
]}, | |
{['_'],cowboy_bench_handler,[]} | |
]} | |
], | |
case cowboy:start_listener(http, 100, | |
cowboy_tcp_transport, [{port, Port}], | |
cowboy_http_protocol, [{dispatch, Dispatch}]) of | |
{ok, Pid}-> | |
register(cowboybehop, Pid), | |
io:format("do something useful"); | |
{_,_}-> | |
io:format("failed to start the server") | |
end, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment