cleanup middleware wrapping
This commit is contained in:
parent
fd54e61a49
commit
8ac33ad829
1 changed files with 14 additions and 12 deletions
|
@ -26,18 +26,20 @@
|
||||||
(POST "/relations" req (create-new-relation! req))
|
(POST "/relations" req (create-new-relation! req))
|
||||||
(POST "/users" req (create-user! req)))
|
(POST "/users" req (create-user! req)))
|
||||||
|
|
||||||
|
(defroutes app-routes
|
||||||
|
(-> home-routes
|
||||||
|
middleware/wrap-csrf
|
||||||
|
middleware/wrap-formats)
|
||||||
|
(-> oauth-routes)
|
||||||
|
(-> admin-routes
|
||||||
|
middleware/wrap-restricted)
|
||||||
|
(route/not-found
|
||||||
|
(:body
|
||||||
|
(error-page {:status 404
|
||||||
|
:title "page not found"}))))
|
||||||
|
|
||||||
(mount/defstate app
|
(mount/defstate app
|
||||||
:start
|
:start
|
||||||
(middleware/wrap-base
|
(-> app-routes
|
||||||
(routes
|
middleware/wrap-base))
|
||||||
(-> #'home-routes
|
|
||||||
(wrap-routes middleware/wrap-csrf)
|
|
||||||
(wrap-routes middleware/wrap-formats))
|
|
||||||
#'oauth-routes
|
|
||||||
(-> #'admin-routes
|
|
||||||
(wrap-routes middleware/wrap-restricted))
|
|
||||||
(route/not-found
|
|
||||||
(:body
|
|
||||||
(error-page {:status 404
|
|
||||||
:title "page not found"}))))))
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue