Skip to content

Commit

Permalink
default interceptor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Sep 7, 2018
1 parent d44911a commit 015eccd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
## HTTP

* [Interceptors](http/interceptors.md)
* [Default Interceptors](http/default_interceptors.md)

## Advanced

Expand Down
3 changes: 2 additions & 1 deletion doc/cljdoc.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]
Expand Down
26 changes: 26 additions & 0 deletions doc/http/default_interceptors.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 1 addition & 5 deletions doc/http/interceptors.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 015eccd

Please sign in to comment.