Compojure routes with different middleware
(defroutes user-routes* (GET “-endpoint1” [] (“USER ENDPOINT 1”)) (GET “-endpoint2” [] (“USER ENDPOINT 1”))) (def user-routes (-> #’user-routes* (wrap-basic-authentication user-auth?))) (defroutes admin-routes* (GET “-endpoint” [] (“ADMIN ENDPOINT”))) (def admin-routes (-> #’admin-routes* (wrap-basic-authentication admin-auth?))) (defroutes main-routes (ANY “*” [] admin-routes) (ANY “*” [] user-routes) This will run the incoming request first through admin-routes and then through … Read more