diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index e6b72f6c..6fb12af0 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -46,6 +46,7 @@ ## HTTP * [Interceptors](http/interceptors.md) +* [Default Interceptors](http/default_interceptors.md) ## Advanced diff --git a/doc/cljdoc.edn b/doc/cljdoc.edn index 37e71e23..a407d3a2 100644 --- a/doc/cljdoc.edn +++ b/doc/cljdoc.edn @@ -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"}] diff --git a/doc/http/default_interceptors.md b/doc/http/default_interceptors.md new file mode 100644 index 00000000..e40e0e34 --- /dev/null +++ b/doc/http/default_interceptors.md @@ -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. diff --git a/doc/http/interceptors.md b/doc/http/interceptors.md index 5e79983f..43273f2b 100644 --- a/doc/http/interceptors.md +++ b/doc/http/interceptors.md @@ -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