0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Add persistent_term support to the router

This commit is contained in:
Loïc Hoguin 2019-09-28 15:40:41 +02:00
parent 7bccad4d21
commit cf84f59d9b
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
5 changed files with 80 additions and 3 deletions

View file

@ -13,7 +13,10 @@ The router takes the `dispatch` rules as input from the
middleware environment. Dispatch rules are generated by
calling the
link:man:cowboy_router:compile(3)[cowboy_router:compile(3)]
function.
function. The environment can contain the rules directly
or a tuple `{persistent_term, Key}`, in which case Cowboy
will call `persistent_term:get(Key)` to retrieve the
dispatch rules.
When a route matches, the router sets the `handler` and
`handler_opts` middleware environment values containing