From 25259671f51c076720b64959a700263eaa0937b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 23 Sep 2014 21:36:52 +0300 Subject: Make routing constraints use the fields format This makes routing more in line with the rest of Cowboy and allows us to use cowboy_constraints directly. --- doc/src/manual/cowboy_router.ezdoc | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'doc/src/manual') diff --git a/doc/src/manual/cowboy_router.ezdoc b/doc/src/manual/cowboy_router.ezdoc index f76acf6..8d45e67 100644 --- a/doc/src/manual/cowboy_router.ezdoc +++ b/doc/src/manual/cowboy_router.ezdoc @@ -22,31 +22,16 @@ Environment output: List of bindings found during routing. -: constraints() = [IntConstraint | FunConstraint] - -Types: - -* IntConstraint = {atom(), int} -* FunConstraint = {atom(), function, Fun} -* Fun = fun((binary()) -> true | {true, any()} | false) - -List of constraints to apply to the bindings. - -The int constraint will convert the binding to an integer. -The fun constraint allows writing custom code for checking -the bindings. Returning a new value from that fun allows -replacing the current binding with a new value. - : dispatch_rules() - opaque to the user Rules for dispatching request used by Cowboy. -: routes() = [{Host, Paths} | {Host, constraints(), Paths}] +: routes() = [{Host, Paths} | {Host, cowboy:fields(), Paths}] Types: * Host = Path = '_' | iodata() -* Paths = [{Path, Handler, Opts} | {Path, constraints(), Handler, Opts}] +* Paths = [{Path, Handler, Opts} | {Path, cowboy:fields(), Handler, Opts}] * Handler = module() * Opts = any() -- cgit v1.2.3