Liking cljdoc? Tell your friends :D

reitit-extras.core

Useful Reitit router middlewares and helpers.

Useful Reitit router middlewares and helpers.
raw docstring

create-resource-handler-cachedclj

(create-resource-handler-cached
  {:keys [cached? cache-control] :or {cached? false} :as opts})

Return resource handler with optional Cache-Control header.

Return resource handler with optional Cache-Control header.
sourceraw docstring

csrf-tokenclj

(csrf-token)

Return the CSRF token value.

Return the CSRF token value.
sourceraw docstring

csrf-token-htmlclj

(csrf-token-html)

Return a hidden input field with the CSRF token.

Return a hidden input field with the CSRF token.
sourceraw docstring

csrf-token-jsonclj

(csrf-token-json)

Return a JSON object as string with the CSRF token. Useful for headers in AJAX requests.

Return a JSON object as string with the CSRF token.
Useful for headers in AJAX requests.
sourceraw docstring

exception-middlewareclj

Common exception middleware to handle all errors.

Common exception middleware to handle all errors.
sourceraw docstring

get-handler-ssrclj

(get-handler-ssr handler-config {:keys [options] :as context})
source

get-routeclj

(get-route router route-name)
(get-route router route-name {:keys [path query]})

Return the API route by its name, with optional path and query parameters.

Return the API route by its name, with optional path and query parameters.
sourceraw docstring

handler-ssrclj

(handler-ssr {:keys [routes default-handlers session-store middlewares]
              :or {middlewares []}}
             {:keys [options] :as context})

Return main application handler for server-side rendering.

DEPRECATED: Define the server directly in a project instead. Can be used as an example of how to create a handler with Reitit.

Return main application handler for server-side rendering.

DEPRECATED: Define the server directly in a project instead.
Can be used as an example of how to create a handler with Reitit.
sourceraw docstring

non-throwing-coerce-request-middlewareclj

Middleware for validating and coercing request parameters based on route specs. Expects a :coercion of type reitit.coercion/Coercion and :parameters defined in route data. If either is missing, the middleware will not mount. Validates request parameters against specs and coerces them to the correct types. If coercion fails, does not throw an exception but passes a request with :errors key containing. Based on reitit.ring.coercion/coerce-request-middleware but does not throw exceptions.

Middleware for validating and coercing request parameters based on route specs.
Expects a `:coercion` of type `reitit.coercion/Coercion` and `:parameters` defined in
route data. If either is missing, the middleware will not mount. Validates request
parameters against specs and coerces them to the correct types. If coercion fails,
does not throw an exception but passes a request with `:errors` key containing.
Based on `reitit.ring.coercion/coerce-request-middleware` but does not throw exceptions.
sourceraw docstring

render-htmlclj

(render-html content)

Render hiccup content as HTML response.

Render hiccup content as HTML response.
sourceraw docstring

string->16-byte-arrayclj

(string->16-byte-array s)
source

wrap-contextclj

(wrap-context handler context)

Add system dependencies of handler to request as a context key.

Add system dependencies of handler to request as a context key.
sourceraw docstring

wrap-reloadclj

(wrap-reload f)

Reload ring handler on every request. Useful in dev mode.

Reload ring handler on every request. Useful in dev mode.
sourceraw docstring

wrap-xss-protectionclj

(wrap-xss-protection handler)
(wrap-xss-protection handler _options)
source

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

× close