Liking cljdoc? Tell your friends :D

bell.core

Functions for creating routes for ring applications.

Functions for creating routes for ring applications.
raw docstring

ANYclj

(ANY pattern handler)

Creates a route for a call with any method to pattern handled by handler.

See route for pattern rules.

Creates a route for a call with any method to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

CONNECTclj

(CONNECT pattern handler)

Creates a route for a CONNECT call to pattern handled by handler.

See route for pattern rules.

Creates a route for a CONNECT call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

DELETEclj

(DELETE pattern handler)

Creates a route for a DELETE call to pattern handled by handler.

See route for pattern rules.

Creates a route for a DELETE call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

GETclj

(GET pattern handler)

Creates a route for a GET call to pattern handled by handler.

See route for pattern rules.

Creates a route for a GET call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

groupclj

(group & routes)

Creates a group that will select among routes for a match. Returns nil if no match is found.

Creates a group that will select among `routes` for a match. Returns nil if
no match is found.
sourceraw docstring

(HEAD pattern handler)

Creates a route for a HEAD call to pattern handled by handler.

See route for pattern rules.

Creates a route for a HEAD call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

OPTIONSclj

(OPTIONS pattern handler)

Creates a route for a OPTIONS call to pattern handled by handler.

See route for pattern rules.

Creates a route for a OPTIONS call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

PATCHclj

(PATCH pattern handler)

Creates a route for a PATCH call to pattern handled by handler.

See route for pattern rules.

Creates a route for a PATCH call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

POSTclj

(POST pattern handler)

Creates a route for a POST call to pattern handled by handler.

See route for pattern rules.

Creates a route for a POST call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

PUTclj

(PUT pattern handler)

Creates a route for a PUT call to pattern handled by handler.

See route for pattern rules.

Creates a route for a PUT call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

routeclj

(route method pattern handler)

Creates a route to match method and pattern to handler. Returns a ring handler that returns the result of handler if the request matches, and nil otherwise.

method should be a keyword that matches an HTTP method, such as :get. It may also be :* to match any method.

pattern is a string that describes the (potentially partial) URI for the request. The pattern may contain path parameters identified by keywords, such as /users/:id. In this example, :id is a path parameter. When a match is found, the route will parse the path parameters into a map attached as :path-params to the request.

pattern may also be a prefix value. If a pattern ends with / (except the root route) or ..., the pattern is treated as a prefix. Here are some examples. The pattern /api/ matches /api/some/other/path and the pattern /images/image-... matches /images/image-logo.png but not images/logo.png.

handler is a ring handler to handle the request if the method and pattern match.

Creates a route to match `method` and `pattern` to `handler`. Returns a ring
handler that returns the result of `handler` if the request matches, and nil
otherwise.

`method` should be a keyword that matches an HTTP method, such as `:get`. It
may also be `:*` to match any method.

`pattern` is a string that describes the (potentially partial) URI for the
request. The pattern may contain path parameters identified by keywords, such
as `/users/:id`. In this example, `:id` is a path parameter. When a match is
found, the route will parse the path parameters into a map attached as
`:path-params` to the request.

`pattern` may also be a prefix value. If a pattern ends with `/` (except the 
root route) or `...`, the pattern is treated as a prefix. Here are some 
examples. The pattern `/api/` matches `/api/some/other/path` and the pattern
`/images/image-...` matches `/images/image-logo.png` but not
`images/logo.png`.

`handler` is a ring handler to handle the request if the method and pattern
match.
sourceraw docstring

routerclj

(router & routes)

Creates a router that will select among routes for a match. Returns a 404 Not Found response if no route matches.

Creates a router that will select among `routes` for a match. Returns a 404
Not Found response if no route matches.
sourceraw docstring

subrouterclj

(subrouter prefix & routes)

Creates a router at prefix and applies requests at that prefix to routes. Returns nil if no match is found. Parses path parameters from prefix into the :path-params field of the request.

Creates a router at `prefix` and applies requests at that prefix to `routes`.
Returns nil if no match is found. Parses path parameters from `prefix` into
the `:path-params` field of the request.
sourceraw docstring

TRACEclj

(TRACE pattern handler)

Creates a route for a TRACE call to pattern handled by handler.

See route for pattern rules.

Creates a route for a TRACE call to `pattern` handled by `handler`.

See [[route]] for pattern rules.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close