Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Depend on clj-config for configuration stuff.

  • Loading branch information...
commit cdd7577ec1192cb5a2debbb31a00aff6fe84e422 1 parent 4d0ead4
@Raynes Raynes authored
Showing with 6 additions and 7 deletions.
  1. +2 −1  project.clj
  2. +4 −6 src/foreclojure/core.clj
View
3  project.clj
@@ -10,7 +10,8 @@
[org.jasypt/jasypt "1.7"]
[amalloy/utils "[0.3.7,)"]
[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"]
[swank-clojure "1.2.1"]]
:main foreclojure.core
View
10 src/foreclojure/core.clj
@@ -4,7 +4,8 @@
ring.adapter.jetty
somnium.congomongo
[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]]
[sandbar.stateful-session :as session]
[ring.util.response :as response]))
@@ -24,15 +25,12 @@
(route/resources "/")
(route/not-found "Page not found"))
-(def config
- (binding [*read-eval* false]
- (read-string
- (slurp (file (System/getProperty "user.dir") "config.clj")))))
+(def config-file (file (System/getProperty "user.dir") "config.clj"))
(def app
(handler/site
(session/wrap-stateful-session
- (if (:wrap-reload config)
+ (if (safely get-key config-file :wrap-reload)
(wrap-reload #'main-routes '(foreclojure.core))
#'main-routes))))
Please sign in to comment.
Something went wrong with that request. Please try again.