diff options
author | Loïc Hoguin <[email protected]> | 2016-08-29 12:39:49 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-08-29 12:40:03 +0200 |
commit | c807880f7ac73f813b2660ea81a00f7712a4e793 (patch) | |
tree | ba1d09e9b177f230665a80513b33fbd532000ce4 /docs/en/cowboy/2.0/guide/routing.asciidoc | |
parent | b1df25a7d9cda697513650659b781b55b40898f8 (diff) | |
download | ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.gz ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.bz2 ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.zip |
Add old mailing list archives
Diffstat (limited to 'docs/en/cowboy/2.0/guide/routing.asciidoc')
-rw-r--r-- | docs/en/cowboy/2.0/guide/routing.asciidoc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/en/cowboy/2.0/guide/routing.asciidoc b/docs/en/cowboy/2.0/guide/routing.asciidoc index 6ac2ebde..864a19a3 100644 --- a/docs/en/cowboy/2.0/guide/routing.asciidoc +++ b/docs/en/cowboy/2.0/guide/routing.asciidoc @@ -37,11 +37,11 @@ PathsList = [Path1, Path2, ... PathN]. Finally, each path contains matching rules for the path along with optional constraints, and gives us the handler module to be used -along with options that will be given to it on initialization. +along with its initial state. [source,erlang] -Path1 = {PathMatch, Handler, Opts}. -Path2 = {PathMatch, Constraints, Handler, Opts}. +Path1 = {PathMatch, Handler, InitialState}. +Path2 = {PathMatch, Constraints, Handler, InitialState}. Continue reading to learn more about the match syntax and the optional constraints. @@ -199,13 +199,13 @@ This can be done with a simple call to `cowboy_router:compile/1`. [source,erlang] ---- Dispatch = cowboy_router:compile([ - %% {HostMatch, list({PathMatch, Handler, Opts})} - {'_', [{'_', my_handler, []}]} + %% {HostMatch, list({PathMatch, Handler, InitialState})} + {'_', [{'_', my_handler, #{}}]} ]), %% Name, NbAcceptors, TransOpts, ProtoOpts -cowboy:start_http(my_http_listener, 100, +cowboy:start_clear(my_http_listener, 100, [{port, 8080}], - [{env, [{dispatch, Dispatch}]}] + #{env => #{dispatch => Dispatch}} ). ---- |