From 8ac33ad8299ae9cbafbdd3353796cde71bd57342 Mon Sep 17 00:00:00 2001 From: flynn Date: Sun, 9 Jun 2019 00:01:51 +0200 Subject: [PATCH] cleanup middleware wrapping --- src/clj/cat/handler.clj | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/clj/cat/handler.clj b/src/clj/cat/handler.clj index c03c964..60677a0 100644 --- a/src/clj/cat/handler.clj +++ b/src/clj/cat/handler.clj @@ -26,18 +26,20 @@ (POST "/relations" req (create-new-relation! 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 :start - (middleware/wrap-base - (routes - (-> #'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"})))))) + (-> app-routes + middleware/wrap-base))