diff --git a/src/wanijo/framework/auth.clj b/src/wanijo/framework/auth.clj index ccf214f..abd587f 100644 --- a/src/wanijo/framework/auth.clj +++ b/src/wanijo/framework/auth.clj @@ -36,8 +36,8 @@ (hform/submit-button "Kama") (anti-forgery-field))])) -(defroutes auth-routes +(defroutes routes (GET "/login" [] login) (POST "/login-check" [] login-check!) - (GET "/logout" [] (fn [_] (-> (redirect "/login") - (assoc :session nil))))) + (GET "/logout" [] (-> (redirect "/login") + (assoc :session nil)))) diff --git a/src/wanijo/handler.clj b/src/wanijo/handler.clj index cde7491..933f24a 100644 --- a/src/wanijo/handler.clj +++ b/src/wanijo/handler.clj @@ -6,9 +6,9 @@ :refer [wrap-defaults site-defaults]] [ring.util.response :as rur] [ring.middleware.session.cookie :as session-cookie] - [wanijo.home.routes :refer [home-routes]] - [wanijo.schema.routes :refer [schema-routes]] - [wanijo.framework.auth :refer [auth-routes]] + [wanijo.home.routes :as home-routes] + [wanijo.schema.routes :as schema-routes] + [wanijo.framework.auth :as auth] [wanijo.framework.devmode :as devmode])) (defn- wrap-login-redirect [handler] @@ -18,10 +18,10 @@ (rur/redirect "/login")))) (defroutes app-routes - (routes auth-routes) + (routes auth/routes) (wrap-login-redirect - (routes home-routes - schema-routes)) + (routes home-routes/routes + schema-routes/routes)) (route/not-found "Not Found")) (def app diff --git a/src/wanijo/home/routes.clj b/src/wanijo/home/routes.clj index 781a012..32c66ac 100644 --- a/src/wanijo/home/routes.clj +++ b/src/wanijo/home/routes.clj @@ -2,5 +2,5 @@ (:require [compojure.core :refer [defroutes GET]] [wanijo.home.view :as home-view])) -(defroutes home-routes +(defroutes routes (GET "/" [] home-view/root!)) diff --git a/src/wanijo/schema/routes.clj b/src/wanijo/schema/routes.clj index d3b0be7..20fd9c6 100644 --- a/src/wanijo/schema/routes.clj +++ b/src/wanijo/schema/routes.clj @@ -21,7 +21,7 @@ (domain/find-by-uuid! uuid) session)) -(defroutes schema-routes +(defroutes routes (GET "/schema" [] view-schema/overview!) (GET "/schema/:uuid" [uuid :as req] (show-schema! uuid (:session req))) (POST "/schema/new" [] new!))