Liking cljdoc? Tell your friends :D

Default Middleware

[metosin/reitit-middleware "0.7.0-alpha5"]

Any Ring middleware can be used with reitit-ring, but using data-driven middleware is preferred as they are easier to manage and in many cases yield better performance. reitit-middleware contains a set of common ring middleware, lifted into data-driven middleware.

Parameters Handling

reitit.ring.middleware.parameters/parameters-middleware to capture query- and form-params. Wraps ring.middleware.params/wrap-params.

NOTE: This middleware will be factored into two parts: a query-parameters middleware and a Muuntaja format responsible for the the application/x-www-form-urlencoded body format. cf.

Exception Handling

See Exception Handling with Ring.

Content Negotiation

See Content Negotiation.

Multipart Request Handling

Wrapper for Ring Multipart Middleware. Emits swagger :consumes definitions automatically.

Expected route data:

[:parameters :multipart]mounts only if defined for a route.
(require '[reitit.ring.middleware.multipart :as multipart])
  • multipart/multipart-middleware a preconfigured middleware for multipart handling
  • multipart/create-multipart-middleware to generate with custom configuration

Inspecting Middleware Chain is a middleware chain transforming function. It prints a request and response diff between each middleware. To use it, add the following router option:


Partial sample output:

Opensensors perf test

Example app

See an example app with the default middleware in action:

Can you improve this documentation? These fine people already did:
Tommi Reiman, Juho Teperi, Miikka Koskinen, tjalkane, Joel Kaasinen, Marcus Spiegel, Dennis Schridde, Phil Hofmann, J Hacksworth & Wanderson Ferreira
Edit on GitHub

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

× close