summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-11-14 21:39:59 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-11-14 21:39:59 +0100
commitfe078e9b5994e8ba9323ffd19d487f7ef88d7a93 (patch)
tree5de6c61848c4f8b58d2ad9ba46f6b415f06bc5ab
parentcb7b221bd15a30083ef39547ed31205337bd6c62 (diff)
Minor fixes.
-rw-r--r--src/mulk/benki/main.clj14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mulk/benki/main.clj b/src/mulk/benki/main.clj
index 40c07cc..a7783fa 100644
--- a/src/mulk/benki/main.clj
+++ b/src/mulk/benki/main.clj
@@ -4,7 +4,7 @@
noir.core
[hiccup core page-helpers]
[mulk.benki util])
- (:require noir.server
+ (:require [noir server options]
[mulk.benki wiki auth]))
@@ -22,10 +22,16 @@
(assoc-in response [:headers "Content-Type"] utf8ctype)
response))))
+(defn wrap-base-uri [handler]
+ (fn [request]
+ (prn "Hello!")
+ (let [base-uri "http://localhost:3001/"]
+ (with-base-url base-uri
+ ((noir.options/wrap-options handler {:base-url base-uri}) request)))))
+
(do-once ::init
- (noir.server/add-middleware #'wrap-utf-8)
- ;;(set! *base-url* nil)
- )
+ (noir.server/add-middleware #(wrap-utf-8 %))
+ (noir.server/add-middleware #(wrap-base-uri %)))
(defn -main [& args]