Liking cljdoc? Tell your friends :D

treo.dispatcher


create-namespace-handlerclj

(create-namespace-handler handler-ns
                          &
                          [{:keys [methods method-fns method-not-allowed-body]
                            :or {method-fns ns-method-fns}}])

Creates a multi-method request handler based on the given namespace. Uses function name conventions to determine which HTTP methods are supported.

Invokes the relevant function when request is processed. Responds with HTTP Bad Method if request method doesn't have a matching function in the namespace.

May optionally specify the supported request methods and the function names that map to them. May optionally specify the response body for the Bad Method response, which defaults to an empty body.

Creates a multi-method request handler based on the given namespace. Uses
function name conventions to determine which HTTP methods are supported.

Invokes the relevant function when request is processed. Responds with HTTP
Bad Method if request method doesn't have a matching function in the namespace.

May optionally specify the supported request methods and the function
names that map to them.
May optionally specify the response body for the Bad Method response, which
defaults to an empty body.
sourceraw docstring

create-route-regexclj

(create-route-regex prefix & route-parts)

Constructs a route regular expression for the given parts of a route. Automatically adds support for URI prefix and trailing slash.

Constructs a route regular expression for the given parts of a route.
Automatically adds support for URI prefix and trailing slash.
sourceraw docstring

name-regexclj

source

named-groupsclj

(named-groups pattern)

Returns sequence of named groups in the given pattern

Returns sequence of named groups in the given pattern
sourceraw docstring

namespace-route-generatorclj

(namespace-route-generator & [prefix])

Generates convenience function for combining regex routes with namespace handlers. May optionally provide a prefix for the routes the function generates.

Returns function that takes two arguments: a string or sequence of strings representing the REST resource and any arguments, and a namespace symbol defining the implemented HTTP methods. Function also takes a variable number of middleware functions that are applied to the namespace handler beforehand but after the route is determined.

Generates convenience function for combining regex routes with namespace
handlers. May optionally provide a prefix for the routes the function
generates.

Returns function that takes two arguments: a string or sequence of strings
representing the REST resource and any arguments, and a namespace symbol
defining the implemented HTTP methods. Function also takes a variable number
of middleware functions that are applied to the namespace handler beforehand
but after the route is determined.
sourceraw docstring

namespaced-handler-fnclj

(namespaced-handler-fn handler-wrapper {:keys [request-method]})

Returns the underlying method function from the namespace handler for the given Ring request. nil is returned if no matched function found.

Returns the underlying method function from the namespace handler for the
given Ring request. nil is returned if no matched function found.
sourceraw docstring

ns-method-fnsclj

Default map of request methods to the relevant namespace function. May be rebound to modify the defaults globally or per usage.

Default map of request methods to the relevant namespace function. May be
rebound to modify the defaults globally or per usage.
sourceraw docstring

routesclj

(routes & handlers)

Create a Ring handler by combining several handlers into one.

Create a Ring handler by combining several handlers into one.
sourceraw docstring

routingclj

(routing request & handlers)

Apply a list of routes to a Ring request map.

Apply a list of routes to a Ring request map.
sourceraw docstring

threading-fnclj

(threading-fn value & fns)

Function version of the threading -> macro that applies the variable sequence of functions consecutively on the given initial value

Function version of the threading -> macro that applies the variable sequence
of functions consecutively on the given initial value
sourceraw docstring

uri-regex-routeclj

(uri-regex-route uri-regex handler)

Creates a route handler that dispatches based on the given URI regex. Any groups are injected into the handler's request.

Creates a route handler that dispatches based on the given URI regex.
Any groups are injected into the handler's request.
sourceraw docstring

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

× close