From 6099415dffcc10b47f939fb043fbdf3718ca618a Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 3 Dec 2011 23:42:03 +0100 Subject: Make web server port and base URI configurable. --- src/mulk/benki/main.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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))) -- cgit v1.2.3