Skip to content

Commit

Permalink
Depend on clj-config for configuration stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Apr 22, 2011
1 parent 4d0ead4 commit cdd7577
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion project.clj
Expand Up @@ -10,7 +10,8 @@
[org.jasypt/jasypt "1.7"] [org.jasypt/jasypt "1.7"]
[amalloy/utils "[0.3.7,)"] [amalloy/utils "[0.3.7,)"]
[clj-github "1.0.0-SNAPSHOT"] [clj-github "1.0.0-SNAPSHOT"]
[ring "0.3.7"]] [ring "0.3.7"]
[clj-config "0.1.0"]]
:dev-dependencies [[lein-ring "0.4.0"] :dev-dependencies [[lein-ring "0.4.0"]
[swank-clojure "1.2.1"]] [swank-clojure "1.2.1"]]
:main foreclojure.core :main foreclojure.core
Expand Down
10 changes: 4 additions & 6 deletions src/foreclojure/core.clj
Expand Up @@ -4,7 +4,8 @@
ring.adapter.jetty ring.adapter.jetty
somnium.congomongo somnium.congomongo
[ring.middleware.reload :only [wrap-reload]] [ring.middleware.reload :only [wrap-reload]]
[clojure.java.io :only [file]]) [clojure.java.io :only [file]]
[clj-config.core :only [safely get-key]])
(:require [compojure [route :as route] [handler :as handler]] (:require [compojure [route :as route] [handler :as handler]]
[sandbar.stateful-session :as session] [sandbar.stateful-session :as session]
[ring.util.response :as response])) [ring.util.response :as response]))
Expand All @@ -24,15 +25,12 @@
(route/resources "/") (route/resources "/")
(route/not-found "Page not found")) (route/not-found "Page not found"))


(def config (def config-file (file (System/getProperty "user.dir") "config.clj"))
(binding [*read-eval* false]
(read-string
(slurp (file (System/getProperty "user.dir") "config.clj")))))


(def app (def app
(handler/site (handler/site
(session/wrap-stateful-session (session/wrap-stateful-session
(if (:wrap-reload config) (if (safely get-key config-file :wrap-reload)
(wrap-reload #'main-routes '(foreclojure.core)) (wrap-reload #'main-routes '(foreclojure.core))
#'main-routes)))) #'main-routes))))


Expand Down

0 comments on commit cdd7577

Please sign in to comment.