summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.sexp.sample4
-rw-r--r--src/mulk/benki/main.clj6
2 files changed, 6 insertions, 4 deletions
diff --git a/config.sexp.sample b/config.sexp.sample
index a7ab1c0..d408257 100644
--- a/config.sexp.sample
+++ b/config.sexp.sample
@@ -4,4 +4,6 @@
:subprotocol "postgresql"
:subname "//localhost:5432/benki"
:user "benki"
- :password ""}}
+ :password ""}
+ :base-uri "http://localhost:3001"
+ :web-port 3001}
diff --git a/src/mulk/benki/main.clj b/src/mulk/benki/main.clj
index 96faadb..a03961c 100644
--- a/src/mulk/benki/main.clj
+++ b/src/mulk/benki/main.clj
@@ -3,7 +3,7 @@
(:use [clojure core repl pprint]
noir.core
[hiccup core page-helpers]
- [mulk.benki util])
+ [mulk.benki util config])
(:require [noir server options]
[mulk.benki wiki auth]
[ring.middleware.file]
@@ -22,7 +22,7 @@
(defn wrap-base-uri [handler]
(fn [request]
- (let [base-uri "http://localhost:3001"]
+ (let [base-uri (:base-uri benki-config)]
(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 3001))
+(defonce server (doto (Thread. #(noir.server/start (:web-port benki-config)))
(.setDaemon true)
(.start)))