diff options
author | Loïc Hoguin <[email protected]> | 2011-05-16 12:08:55 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-05-16 12:08:55 +0200 |
commit | 98b9b1124ca96655a774259e3f18693161f42cfa (patch) | |
tree | e874d05a3b738ea45315d0fb9a53d8922fa4b2b5 /README.md | |
parent | 9f06bac7bff3c8a8edbd90e3de80792c45c03578 (diff) | |
parent | 4e09d776f5368f432971429f9868052f55151555 (diff) | |
download | cowboy-98b9b1124ca96655a774259e3f18693161f42cfa.tar.gz cowboy-98b9b1124ca96655a774259e3f18693161f42cfa.tar.bz2 cowboy-98b9b1124ca96655a774259e3f18693161f42cfa.zip |
Merge remote-tracking branch 'nox/path-info'
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -124,6 +124,16 @@ you accept anything in that position. For example if you have both "dev-extend.eu" and "dev-extend.fr" domains, you can use the match spec `[<<"dev-extend">>, '_']` to match any top level extension. +Finally, you can also match multiple leading segments of the domain name and +multiple trailing segments of the request path using the atom `'...'` (the atom +ellipsis) respectively as the first host token or the last path token. For +example, host rule `['...', <<"dev-extend">>, <<"eu">>]` can match both +"cowboy.bugs.dev-extend.eu" and "dev-extend.eu" and path rule +`[<<"projects">>, '...']` can math both "/projects" and +"/projects/cowboy/issues/42". The host leading segments and the path trailing +segments can later be retrieved through `cowboy_http_req:host_info/1` and +`cowboy_http_req:path_info/1`. + Any other atom used as a token will bind the value to this atom when matching. To follow on our hostnames example, `[<<"dev-extend">>, ext]` would bind the values `<<"eu">>` and `<<"fr">>` to the ext atom, that you |