mount/test/app/config.clj

16 lines
446 B
Clojure
Raw Normal View History

2015-10-20 12:53:09 +00:00
(ns app.config
2015-10-20 01:33:56 +00:00
(:require [mount :refer [defstate]]
[clojure.edn :as edn]
[clojure.tools.logging :refer [info]]))
(defn load-config [path]
(info "loading config from" path)
2015-11-14 03:06:27 +00:00
(if (:help (mount/args))
(info "\n\nthis is a sample mount app to demo how to pass and read runtime arguments\n"))
2015-10-20 01:33:56 +00:00
(-> path
slurp
edn/read-string))
(defstate app-config
:start (load-config "test/resources/config.edn"))