From 48f39402181d959cad88cb3f460210c007169f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 12 May 2021 11:13:47 +0200 Subject: Cowboy 2.9.0 --- .../2.9/manual/cowboy_router.compile/index.html | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 docs/en/cowboy/2.9/manual/cowboy_router.compile/index.html (limited to 'docs/en/cowboy/2.9/manual/cowboy_router.compile/index.html') diff --git a/docs/en/cowboy/2.9/manual/cowboy_router.compile/index.html b/docs/en/cowboy/2.9/manual/cowboy_router.compile/index.html new file mode 100644 index 00000000..d3a616fd --- /dev/null +++ b/docs/en/cowboy/2.9/manual/cowboy_router.compile/index.html @@ -0,0 +1,200 @@ + + + + + + + + + + Nine Nines: cowboy_router:compile(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cowboy_router:compile(3)

+ +

Name

+

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.

+

Arguments

+
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.

+

Changelog

+
  • 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}
+}).
+
+

See also

+

cowboy_router(3)

+ + + + + + +
+ +
+ + +

+ Cowboy + 2.9 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3