Defines a default middleware stack for donut apps.
Defines a default middleware stack for donut apps.
(app-middleware handler & [config])
A donut.system component that applies configured middleware to a handler
A donut.system component that applies configured middleware to a handler
A default configuration for a browser-accessible website, based on current best practice.
A default configuration for a browser-accessible website, based on current best practice.
This is route middleware because it's applied after reitit matches a route; it relies on route info.
This is route middleware because it's applied after reitit matches a route; it relies on route info.
(wrap-default-index handler
&
[{:keys [root exclude status]
:or {root "public" exclude ["json"] status 404}}])
(wrap-format-exception handler {:keys [include-data]})
Catches exceptions and returns a formatted response.
Catches exceptions and returns a formatted response.
(wrap-latency handler {:keys [sleep sleep-max]})
Introduce latency, useful for local dev when you want to simulate more realistic response times
Introduce latency, useful for local dev when you want to simulate more realistic response times
(wrap-merge-params handler)
Merge all params maps, place under :all-params
Merge all params maps, place under `:all-params`
(wrap-muuntaja-encode handler)
indicate we want to encode response with muuntaja. muuntaja handles the conversion between clojure data structures and wire formats
indicate we want to encode response with muuntaja. muuntaja handles the conversion between clojure data structures and wire formats
(wrap-not-found handler)
(wrap-not-found handler error-handler)
Middleware that returns a 404 'Not Found' response from an error handler if the base handler returns nil.
Used to provide the index.html file by default for frontend routes
Middleware that returns a 404 'Not Found' response from an error handler if the base handler returns nil. Used to provide the index.html file by default for frontend routes
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close