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

Small routing guide fix

Make cowboy_router:compile/1 return to be consistent with current
implementation.
This commit is contained in:
Ivan Lisenkov 2013-01-31 00:41:14 +04:00
parent a3c0ff9ccf
commit 60291c6878

View file

@ -229,14 +229,14 @@ handler to run instead of having to parse the routes repeatedly.
This can be done with a simple call to `cowboy_router:compile/1`.
``` erlang
{ok, Routes} = cowboy_router:compile([
Dispatch = cowboy_router:compile([
%% {HostMatch, list({PathMatch, Handler, Opts})}
{'_', [{'_', my_handler, []}]}
]),
%% Name, NbAcceptors, TransOpts, ProtoOpts
cowboy:start_http(my_http_listener, 100,
[{port, 8080}],
[{env, [{routes, Routes}]}]
[{env, [{dispatch, Dispatch}]}]
).
```