From 92b54aacc0de5446dd5497c39897b0bbff72e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Jun 2018 09:54:12 +0200 Subject: Rebuild using Asciideck --- docs/en/cowboy/2.3/manual/cowboy_router/index.html | 117 +++++++-------------- 1 file changed, 36 insertions(+), 81 deletions(-) (limited to 'docs/en/cowboy/2.3/manual/cowboy_router/index.html') diff --git a/docs/en/cowboy/2.3/manual/cowboy_router/index.html b/docs/en/cowboy/2.3/manual/cowboy_router/index.html index dae2a362..a5895995 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_router/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_router/index.html @@ -62,110 +62,65 @@

cowboy_router(3)

-

Name

-
-

cowboy_router - Router middleware

-
-
-
+

cowboy_router - Router middleware

Description

-
-

The cowboy_router middleware maps the requested host and -path to the handler to be used for processing the request.

-

The router takes the dispatch rules as input from the -middleware environment. Dispatch rules are generated by -calling the -cowboy_router:compile(3) -function.

-

When a route matches, the router sets the handler and -handler_opts middleware environment values containing -the handler module and initial state, respectively.

-

The router will stop execution when no route matches. -It will send a 400 response if no host was found, and -a 404 response otherwise.

-
-
-
+

The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request.

+

The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function.

+

When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively.

+

The router will stop execution when no route matches. It will send a 400 response if no host was found, and a 404 response otherwise.

Exports

-
-
-
-
-
+

Types

-
-

bindings()

-
-
-
bindings() :: #{atom() => any()}
-

Bindings found during routing.

-
-
+
bindings() :: #{atom() => any()}
+
+

Bindings found during routing.

dispatch_rules()

-

Opaque type containing the compiled routes.

-
-
+

Opaque type containing the compiled routes.

routes()

-
-
-
routes() = [
-    {Host, PathList} |
-    {Host, Fields, PathList}
+
routes() = [
+    {Host, PathList} |
+    {Host, Fields, PathList}
 ]
 
-PathList :: [
-    {Path, Handler, InitialState} |
-    {Path, Fields, Handler, InitialState}
+PathList :: [
+    {Path, Handler, InitialState} |
+    {Path, Fields, Handler, InitialState}
 ]
 
-Host         :: '_' | iodata()
-Path         :: '_' | iodata()
-Fields       :: cowboy:fields()
-Handler      :: module()
-InitialState :: any()
-

Human readable list of routes to handlers.

-

Cowboy uses this list to map hosts and paths, optionally -augmented with constraints applied to the bindings, to -handler modules.

-

The syntax for routes is currently defined in the user guide.

-
-
+Host :: '_' | iodata() +Path :: '_' | iodata() +Fields :: cowboy:fields() +Handler :: module() +InitialState :: any() +
+

Human readable list of routes to handlers.

+

Cowboy uses this list to map hosts and paths, optionally augmented with constraints applied to the bindings, to handler modules.

+

The syntax for routes is currently defined in the user guide.

+ +

tokens()

-
-
-
tokens() :: [binary()]
-

List of host_info and path_info tokens that were found -using the ... syntax.

- - - -
+
tokens() :: [binary()]
+
+

List of host_info and path_info tokens that were found using the ... syntax.

See also

-
- -
- +

cowboy(7), cowboy_req:binding(3), cowboy_req:bindings(3), cowboy_req:host_info(3), cowboy_req:path_info(3)

+ -- cgit v1.2.3