mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
1.3 KiB
1.3 KiB
Interceptors (WIP)
Reitit also support for Pedestal-style 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.
Current Status
Work-in-progress and considered alpha quality.
Reitit-http
[metosin/reitit-http "0.2.1"]
An module for http-routing using interceptors instead of middleware. Builds on top of the reitit-ring module. The differences:
- instead of
:middleware, uses:interceptors - compared to
reitit.http/http-routertakes an extra options map with mandatory key:executor(of typereitit.interceptor/Executor) and optional top level:interceptors- wrapping both routes and default handler. - optional entry poitn
reitit.http/routing-interceptorto provide a routing interceptor, to be used with Pedestal.
Examples
Sieppari
See code at: https://github.com/metosin/reitit/tree/master/examples/http
Pedestal
See example at: https://github.com/metosin/reitit/tree/master/examples/pedestal