Liking cljdoc? Tell your friends :D

kekkonen.middleware


+default-options+clj

source

api-infoclj

(api-info options)

Inputs: [options]

Inputs: [options]
sourceraw docstring

coerce-error-handlerclj

(coerce-error-handler f)
source

create-muuntajaclj

(create-muuntaja options)
source

stringifyclj

(stringify error)

Stringifies symbols and validation errors in Schema error, keeping the structure intact.

Stringifies symbols and validation errors in Schema error, keeping the structure intact.
sourceraw docstring

wrap-apiclj

(wrap-api handler)
(wrap-api handler options)

Opinionated chain of middlewares for web apis. Takes options-map to configure all the needed middlewares. See details and defaults from the source.

Accepts the following options:

  • :exceptions options for kekkonen.core/wrap-exceptions

    • :handlers - map of type->exception-handler for exceptions. exception-handlers take 3 arguments: the exception, ExceptionInfo data and the originating request. tip: to catch normal Schema errors use :schema.core/error as type
  • :not-found a function request=>response to handle nil responses

  • :formats value should be :muuntaja.middleware/defaults (default), Muuntaja options map or a created Muuntaja. See Muuntaja wiki for details: https://github.com/metosin/muuntaja/wiki/Configuration

Opinionated chain of middlewares for web apis. Takes options-map to configure
all the needed middlewares. See details and defaults from the source.

Accepts the following options:

- :exceptions        options for kekkonen.core/wrap-exceptions
  - :handlers        - map of type->exception-handler for exceptions. exception-handlers
                     take 3 arguments: the exception, ExceptionInfo data and the originating request.
                     tip: to catch normal Schema errors use :schema.core/error as type

- :not-found         a function request=>response to handle nil responses

- :formats           value should be :muuntaja.middleware/defaults (default), Muuntaja options
                     map or a created Muuntaja. See Muuntaja wiki for details:
                     https://github.com/metosin/muuntaja/wiki/Configuration
sourceraw docstring

wrap-exceptionsclj

(wrap-exceptions handler {:keys [handlers default]})

Catches all exceptions and delegates to right error handler accoring to :type of Exceptions :handlers - a map from exception type to handler :default - default handler for everything no caught by handlers

Catches all exceptions and delegates to right error handler accoring to :type of Exceptions
:handlers  - a map from exception type to handler
:default   - default handler for everything no caught by handlers
sourceraw docstring

wrap-keyword-keysclj

(wrap-keyword-keys handler path)
source

wrap-not-foundclj

(wrap-not-found handler f)
source

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

× close