Liking cljdoc? Tell your friends :D

reitit.ring


coerce-handlerclj/s

(coerce-handler [path data] {:keys [expand] :as opts})
source

compile-resultclj/s

(compile-result [path data]
                {:keys [:reitit.ring/default-options-handler] :as opts})
source

create-default-handlerclj/s

(create-default-handler)
(create-default-handler {:keys [not-found method-not-allowed not-acceptable]})

A default ring handler that can handle the following cases, configured via options:

keydescription
:not-found404, no routes matches
:method-not-accepted405, no method matches
:not-acceptable406, handler returned nil
A default ring handler that can handle the following cases,
configured via options:

| key                    | description |
| -----------------------|-------------|
| `:not-found`           | 404, no routes matches
| `:method-not-accepted` | 405, no method matches
| `:not-acceptable`      | 406, handler returned `nil`
sourceraw docstring

create-resource-handlerclj

(create-resource-handler)
(create-resource-handler {:keys [parameter root path loader allow-symlinks?
                                 index-files paths]
                          :or {parameter (keyword "")
                               root "public"
                               index-files ["index.html"]
                               paths (constantly nil)}})

A ring handler for serving classpath resources, configured via options:

keydescription
:parameteroptional name of the wildcard parameter, defaults to unnamed keyword :
:rootoptional resource root, defaults to "public"
:pathoptional path to mount the handler to. Works only if mounted outside of a router.
:loaderoptional class loader to resolve the resources
:index-filesoptional vector of index-files to look in a resource directory, defaults to ["index.html"]
A ring handler for serving classpath resources, configured via options:

| key              | description |
| -----------------|-------------|
| :parameter       | optional name of the wildcard parameter, defaults to unnamed keyword `:`
| :root            | optional resource root, defaults to `"public"`
| :path            | optional path to mount the handler to. Works only if mounted outside of a router.
| :loader          | optional class loader to resolve the resources
| :index-files     | optional vector of index-files to look in a resource directory, defaults to `["index.html"]`
sourceraw docstring

default-options-handlerclj/s

(default-options-handler request)
source

Endpointcljs

source

get-matchclj/s

(get-match request)
source

get-routerclj/s

(get-router handler)
source

group-keysclj/s

(group-keys data)
source

http-methodsclj/s

source

Methodscljs

source

ring-handlerclj/s

(ring-handler router)
(ring-handler router default-handler)
(ring-handler router default-handler {:keys [middleware]})

Creates a ring-handler out of a router, optional default ring-handler and options map, with the following keys:

keydescription
:middlewareOptional sequence of middleware that wrap the ring-handler
Creates a ring-handler out of a router, optional default ring-handler
and options map, with the following keys:

| key           | description |
| --------------|-------------|
| `:middleware` | Optional sequence of middleware that wrap the ring-handler
sourceraw docstring

routerclj/s

(router data)
(router data opts)

Creates a [[reitit.core/Router]] from raw route data and optionally an options map with support for http-methods and Middleware. See docs for details.

Options:

keydescription
:reitit.middleware/transformFunction of [Middleware] => [Middleware] to transform the expanded Middleware (default: identity).
:reitit.middleware/registryMap of keyword => IntoMiddleware to replace keyword references into Middleware
:reitit.ring/default-options-handlerDefault handler for :options method in endpoints (default: default-options-handler)

Example:

(router
  ["/api" {:middleware [wrap-format wrap-oauth2]}
    ["/users" {:get get-user
                 :post update-user
                 :delete {:middleware [wrap-delete]
                         :handler delete-user}}]])
Creates a [[reitit.core/Router]] from raw route data and optionally an options map with
support for http-methods and Middleware. See [docs](https://metosin.github.io/reitit/)
for details.

Options:

| key                                    | description |
| ---------------------------------------|-------------|
| `:reitit.middleware/transform`         | Function of `[Middleware] => [Middleware]` to transform the expanded Middleware (default: identity).
| `:reitit.middleware/registry`          | Map of `keyword => IntoMiddleware` to replace keyword references into Middleware
| `:reitit.ring/default-options-handler` | Default handler for `:options` method in endpoints (default: default-options-handler)

Example:

    (router
      ["/api" {:middleware [wrap-format wrap-oauth2]}
        ["/users" {:get get-user
                     :post update-user
                     :delete {:middleware [wrap-delete]
                             :handler delete-user}}]])
sourceraw docstring

routesclj/s

(routes & handlers)

Create a ring handler by combining several handlers into one.

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

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

× close