summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mulk/benki/config.clj2
-rw-r--r--src/mulk/benki/db.clj6
-rw-r--r--src/mulk/benki/main.clj4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mulk/benki/config.clj b/src/mulk/benki/config.clj
index 4b9493b..cd3c8b7 100644
--- a/src/mulk/benki/config.clj
+++ b/src/mulk/benki/config.clj
@@ -2,4 +2,4 @@
(:refer-clojure))
(def benki-config
- (read-string (slurp "config.sexp")))
+ (atom (read-string (slurp "config.sexp"))))
diff --git a/src/mulk/benki/db.clj b/src/mulk/benki/db.clj
index 61de478..343b09f 100644
--- a/src/mulk/benki/db.clj
+++ b/src/mulk/benki/db.clj
@@ -4,11 +4,11 @@
(:require [clojure.java.jdbc :as sql]))
-(def ^:private db
- (:database benki-config))
+(defn ^:private db []
+ (:database @benki-config))
(defn call-with-db [thunk]
- (sql/with-connection db
+ (sql/with-connection (db)
(thunk)))
(defmacro with-db [& body]
diff --git a/src/mulk/benki/main.clj b/src/mulk/benki/main.clj
index 2f4101f..09def98 100644
--- a/src/mulk/benki/main.clj
+++ b/src/mulk/benki/main.clj
@@ -22,7 +22,7 @@
(defn wrap-base-uri [handler]
(fn [request]
- (let [base-uri (:base-uri benki-config)]
+ (let [base-uri (:base-uri @benki-config)]
(hiccup.core/with-base-url base-uri
((noir.options/wrap-options handler {:base-url base-uri}) request)))))
@@ -31,7 +31,7 @@
(noir.server/add-middleware #(wrap-base-uri %))
(noir.server/add-middleware #(ring.middleware.file/wrap-file % "static")))
-(defonce server (doto (Thread. #(noir.server/start (:web-port benki-config)))
+(defonce server (doto (Thread. #(noir.server/start (:web-port @benki-config)))
(.setDaemon true)
(.start)))