Module cowboy_router

Behaviours: cowboy_middleware.

Data Types

bindings()

bindings() = [{atom(), binary()}]

constraints()

constraints() = [{atom(), int} | {atom(), function, fun((binary()) -> true | {true, any()} | false)}]

dispatch_rules()

abstract datatype: dispatch_rules()

route_match()

route_match() = '_' | iodata()

route_path()

route_path() = {Path::route_match(), Handler::module(), Opts::any()} | {Path::route_match(), constraints(), Handler::module(), Opts::any()}

route_rule()

route_rule() = {Host::route_match(), Paths::[route_path()]} | {Host::route_match(), constraints(), Paths::[route_path()]}

routes()

routes() = [route_rule()]

tokens()

tokens() = [binary()]

Function Index

compile/1
execute/2

Function Details

compile/1

compile(Routes::routes()) -> dispatch_rules()

execute/2

execute(Req, Env) -> {ok, Req, Env} | {error, 400 | 404, Req}


Generated by EDoc, Oct 16 2014, 12:31:57.