mirror of
https://github.com/metosin/reitit.git
synced 2025-12-29 04:38:26 +00:00
default interceptor docs
This commit is contained in:
parent
d44911a4c4
commit
015eccd115
4 changed files with 30 additions and 6 deletions
|
|
@ -46,6 +46,7 @@
|
|||
## HTTP
|
||||
|
||||
* [Interceptors](http/interceptors.md)
|
||||
* [Default Interceptors](http/default_interceptors.md)
|
||||
|
||||
## Advanced
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@
|
|||
["Browser integration" {:file "doc/frontend/browser.md"}]
|
||||
["Controllers (WIP)" {:file "doc/frontend/controllers.md"}]]
|
||||
["HTTP" {}
|
||||
["Interceptors" {:file "doc/http/interceptors.md"}]]
|
||||
["Interceptors" {:file "doc/http/interceptors.md"}]
|
||||
["Default Interceptors" {:file "doc/http/default_interceptors.md"}]]
|
||||
["Advanced" {}
|
||||
["Configuring Routers" {:file "doc/advanced/configuring_routers.md"}]
|
||||
["Composing Routers" {:file "doc/advanced/composing_routers.md"}]
|
||||
|
|
|
|||
26
doc/http/default_interceptors.md
Normal file
26
doc/http/default_interceptors.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Default Interceptors
|
||||
|
||||
```clj
|
||||
[metosin/reitit-interceptors "0.2.1"]
|
||||
```
|
||||
|
||||
Just like the [ring default middleware](../ring/default_middleware.md), but for interceptors. The default interceptors are:
|
||||
|
||||
### Parameters handling
|
||||
* `reitit.http.interceptors.parameters/parameters-interceptor`
|
||||
|
||||
### Exception handling
|
||||
* `reitit.http.interceptors.exception/exception-interceptor`
|
||||
|
||||
### Content Negotiation
|
||||
* `reitit.http.interceptors.muuntaja/format-interceptor`
|
||||
* `reitit.http.interceptors.muuntaja/format-negotiate-interceptor`
|
||||
* `reitit.http.interceptors.muuntaja/format-request-interceptor`
|
||||
* `reitit.http.interceptors.muuntaja/format-response-interceptor`
|
||||
|
||||
### Multipart request handling
|
||||
* `reitit.http.interceptors.multipart/multipart-interceptor`
|
||||
|
||||
## Example app
|
||||
|
||||
See an example app with the default interceptors in action: https://github.com/metosin/reitit/blob/master/examples/http-swagger/src/example/server.clj.
|
||||
|
|
@ -1,11 +1,7 @@
|
|||
# Interceptors (WIP)
|
||||
# Interceptors
|
||||
|
||||
Reitit also support for [Pedestal](pedestal.io)-style [interceptors](http://pedestal.io/reference/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](https://github.com/pedestal/pedestal/tree/master/interceptor) or [Sieppari](https://github.com/metosin/sieppari) to execute the chains.
|
||||
|
||||
## Current Status
|
||||
|
||||
Work-in-progress and considered alpha quality.
|
||||
|
||||
## Reitit-http
|
||||
|
||||
```clj
|
||||
|
|
|
|||
Loading…
Reference in a new issue