Revamps all of the IOL's routing, so that the new history page can share with the rest.

This commit is contained in:
2023-01-12 16:56:40 -08:00
parent ce01a63797
commit 46dd191391
29 changed files with 1294 additions and 1053 deletions

View File

@@ -4,8 +4,6 @@
[auto-ap.logging :refer [warn-event]]
[buddy.auth :refer [throw-unauthorized]]
[clojure.edn :as edn]
[compojure.core :refer [GET POST context defroutes
wrap-routes]]
[clojure.tools.logging :as log]))
(defn handle-graphql [{:keys [request-method query-params] :as r}]
(when (= "none" (:user/role (:identity r)))
@@ -39,9 +37,5 @@
:headers {"Content-Type" "application/edn"}}))))))
(defroutes routes
(wrap-routes
(context "/graphql" []
(GET "/" x (handle-graphql x))
(POST "/" x (handle-graphql x)))
wrap-secure))
(def routes {"api/" {#"graphql/?" :graphql}})
(def match->handler {:graphql (wrap-secure handle-graphql)})