Liking cljdoc? Tell your friends :D

Interceptors

Reitit also support for interceptors as an alternative to using middleware. Basic interceptor handling is implemented in reitit.interceptor package. There is no interceptor executor shipped, but you can use libraries like Pedestal Interceptor or Sieppari to execute the chains.

Reitit-http

[metosin/reitit-http "0.2.9"]

An module for http-routing using interceptors instead of middleware. Builds on top of the reitit-ring module having all the same features.

The differences:

  • instead of :middleware, uses :interceptors.
  • reitit.http/http-router requires an extra option :executor of type reitit.interceptor/Executor.
  • instead of creating a ring-handler, apps can be wrapped into a routing interceptor that enqueues the matched interceptors into the context. For this, there is reitit.http/routing-interceptor.

Why interceptors?

Can you improve this documentation?Edit on GitHub

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

× close