cowboy_router - router middleware
The cowboy_router
middleware maps the requested host and
path to the handler to be used for processing the request.
It uses the dispatch rules compiled from the routes given
to the compile/1
function for this purpose. It adds the
handler name and options to the environment as the values
handler
and handler_opts
respectively.
Dispatch table.
Handler module.
Handler options.
List of bindings found during routing.
Rules for dispatching request used by Cowboy.
With types:
Host = Path = _ | iodata()
Paths = [{Path, Handler, Opts} | {Path, cowboy:fields(), Handler, HandlerOpts}]
Handler = module()
HandlerOpts = any()
Human readable list of routes mapping hosts and paths to handlers.
The syntax for routes is defined in the user guide.
List of host_info and path_info tokens found during routing.
Compile the routes for use by Cowboy.