Behaviours: cowboy_middleware.
Routing middleware.
Resolve the handler to be used for the request based on the routing information found in the dispatch environment value. When found, the handler module and associated data are added to the environment as the handler and handler_opts values respectively.
If the route cannot be found, processing stops with either a 400 or a 404 reply.bindings() = [{atom(), binary()}]
constraints() = [{atom(), int} | {atom(), function, fun((binary()) -> true | {true, any()} | false)}]
abstract datatype: dispatch_rules()
route_match() = '_' | binary() | string()
route_path() = {Path::route_match(), Handler::module(), Opts::any()} | {Path::route_match(), constraints(), Handler::module(), Opts::any()}
route_rule() = {Host::route_match(), Paths::[route_path()]} | {Host::route_match(), constraints(), Paths::[route_path()]}
routes() = [route_rule()]
tokens() = [binary()]
compile/1 | Compile a list of routes into the dispatch format used by Cowboy's routing. |
compile(Routes::routes()) -> dispatch_rules()
Compile a list of routes into the dispatch format used by Cowboy's routing.
Generated by EDoc, Aug 16 2014, 11:28:19.