automated imports.

This commit is contained in:
BC
2018-06-14 23:16:10 -07:00
parent a17b6b9688
commit 80112d08a7
19 changed files with 458 additions and 71 deletions

View File

@@ -6,6 +6,7 @@
[auto-ap.routes.reminders :as reminders]
[auto-ap.routes.graphql :as graphql]
[auto-ap.routes.vendors :as vendors]
[auto-ap.routes.events :as events]
[auto-ap.routes.checks :as checks]
[auto-ap.db.utils :as u]
[buddy.auth.backends.token :refer [jws-backend]]
@@ -41,11 +42,6 @@
(def auth-backend (jws-backend {:secret (:jwt-secret env) :options {:alg :hs512}}))
(def app-routes
(routes
api-routes
static-routes))
(defn wrap-transaction [handler]
(fn [request]
(jdbc/with-db-transaction [t (u/get-conn)]
@@ -56,9 +52,18 @@
(jdbc/db-set-rollback-only! t)
(throw e)))))))
(def app-routes
(routes
(wrap-transaction api-routes)
(context "/api" [] events/routes)
static-routes))
(def app
(-> #'app-routes
(wrap-transaction)
(wrap-authorization auth-backend)
(wrap-authentication auth-backend)
(wrap-reload)