diff options
author | Loïc Hoguin <[email protected]> | 2013-01-03 22:47:51 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-01-03 22:47:51 +0100 |
commit | 1b3f510b7e8d5413901ba72adfe361773f3e9097 (patch) | |
tree | 314d24a8bbbdfc1e326cac28193ab6d9f7dc3b61 /guide/routing.md | |
parent | 73d86057f2f9d6b3de5fb12e23b2cd65be50e226 (diff) | |
download | cowboy-1b3f510b7e8d5413901ba72adfe361773f3e9097.tar.gz cowboy-1b3f510b7e8d5413901ba72adfe361773f3e9097.tar.bz2 cowboy-1b3f510b7e8d5413901ba72adfe361773f3e9097.zip |
Add middleware support
Middlewares allow customizing the request processing.
All existing Cowboy project are incompatible with this commit.
You need to change `{dispatch, Dispatch}` in the protocol options
to `{env, [{dispatch, Dispatch}]}` to fix your code.
Diffstat (limited to 'guide/routing.md')
-rw-r--r-- | guide/routing.md | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/guide/routing.md b/guide/routing.md index 936b37c..7d6fa41 100644 --- a/guide/routing.md +++ b/guide/routing.md @@ -135,18 +135,15 @@ handler to run instead of having to parse the routes repeatedly. This can be done with a simple call to `cowboy_routing:compile/1`. -@todo Note that the `routes` option will be specified slightly differently -when middleware support gets in. - ``` erlang {ok, Routes} = cowboy_routing:compile([ - %% {URIHost, list({URIPath, Handler, Opts})} + %% {HostMatch, list({PathMatch, Handler, Opts})} {'_', [{'_', my_handler, []}]} ]), %% Name, NbAcceptors, TransOpts, ProtoOpts cowboy:start_http(my_http_listener, 100, [{port, 8080}], - [{routes, Routes}] + [{env, [{routes, Routes}]}] ). ``` |