Skip to content

Commit 68cf40c

Browse files
committed
Update README.md
1 parent 7830fc8 commit 68cf40c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ To help setting up custom middleware there is a `compojure.api.core/middlewares`
192192
(GET "/ping" [] (ok {:ping "pong"})))))
193193
```
194194

195+
If you want to wrap you complete app in some middlewares, `defapi` returns handler which you can wrap just like with regular `defroutes`:
196+
197+
```clojure
198+
(defapi app' ...)
199+
(def app (-> app' (wrap-head)))
200+
```
201+
195202
## Route macros
196203

197204
One can use either [vanilla Compojure routes](https://github.com/weavejester/compojure/wiki) or their enhanced versions from `compojure.api.core`.

0 commit comments

Comments
 (0)