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 --- .../2.3/manual/cowboy_router.compile/index.html | 93 +++++++--------------- 1 file changed, 27 insertions(+), 66 deletions(-) (limited to 'docs/en/cowboy/2.3/manual/cowboy_router.compile/index.html') diff --git a/docs/en/cowboy/2.3/manual/cowboy_router.compile/index.html b/docs/en/cowboy/2.3/manual/cowboy_router.compile/index.html index 1904d026..eb6bb8c8 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_router.compile/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_router.compile/index.html @@ -62,87 +62,48 @@

cowboy_router:compile(3)

-

Name

-
-

cowboy_router:compile - Compile routes to the resources

-
-
-
+

cowboy_router:compile - Compile routes to the resources

Description

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

Compile routes to the resources.

-

Takes a human readable list of routes and transforms it -into a form more efficient to process.

-
-
-
+
compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules()
+
+

Compile routes to the resources.

+

Takes a human readable list of routes and transforms it into a form more efficient to process.

Arguments

-
-
-
-Routes -
-
-

-Human readable list of routes. -

+
Routes
+

Human readable list of routes.

-
-
- -
+

Return value

-
-

An opaque dispatch rules value is returned. This value -must be given to Cowboy as a middleware environment value.

-
-
-
+

An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value.

Changelog

-
-
    -
  • -

    -1.0: Function introduced. -

    +
    • 1.0: Function introduced.
    • -
-
-
-
+

Examples

-
-
-
Compile routes and start a listener
-
-
Dispatch = cowboy_router:compile([
-    {'_', [
-        {"/", toppage_h, []},
-        {"/[...], cowboy_static, {priv_dir, my_example_app, ""}}
-    ]}
-]),
-
-{ok, _} = cowboy:start_clear(example, [{port, 8080}], #{
-    env => #{dispatch => Dispatch}
-}).
-
-
-
+
Dispatch = cowboy_router:compile([
+    {'_', [
+        {"/", toppage_h, []},
+        {"/[...], cowboy_static, {priv_dir, my_example_app, ""}}
+    ]}
+]),
+
+{ok, _} = cowboy:start_clear(example, [{port, 8080}], #{
+    env => #{dispatch => Dispatch}
+}).
+

See also

-
- -
- +

cowboy_router(3)

+ -- cgit v1.2.3