From fe078e9b5994e8ba9323ffd19d487f7ef88d7a93 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 14 Nov 2011 21:39:59 +0100 Subject: Minor fixes. --- src/mulk/benki/main.clj | 14 ++++++++++---- 1 file 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] -- cgit v1.2.3