diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-12-03 23:42:03 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-12-03 23:42:03 +0100 |
commit | 6099415dffcc10b47f939fb043fbdf3718ca618a (patch) | |
tree | 8bc8afd079dffdf37f51726eca3db58daad846a7 | |
parent | e1feb02f5fbaa7dbb3c83ac26fd3eb00f9b72b36 (diff) |
Make web server port and base URI configurable.
-rw-r--r-- | config.sexp.sample | 4 | ||||
-rw-r--r-- | src/mulk/benki/main.clj | 6 |
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))) |