From 1b3f510b7e8d5413901ba72adfe361773f3e9097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Jan 2013 22:47:51 +0100 Subject: 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. --- guide/routing.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'guide/routing.md') 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}]}] ). ``` -- cgit v1.2.3