added proper configuration using aero
This commit is contained in:
1 parent
c823775c0c
commit
d2c554dcc8
8 files changed
+43
-14
No files matched your search
+11
-6
@@ -1,10 +1,15 @@
|
||||
(ns book.core
|
||||
(:require [book.cli]
|
||||
[book.web])
|
||||
(:require [book.cli.core]
|
||||
[book.rest.core]
|
||||
[aero.core :refer (read-config)])
|
||||
(:gen-class))
|
||||
|
||||
(def apps {:webserver book.rest.core/-main})
|
||||
|
||||
(defn -main [& argv]
|
||||
(case (first argv)
|
||||
"web" (apply book.web/-main (rest argv))
|
||||
"cli" (apply book.cli/-main (rest argv))
|
||||
(println "First argument must be web or cli")))
|
||||
(let [config (-> "config.edn" clojure.java.io/resource read-config)
|
||||
target (-> argv first keyword)
|
||||
target-fn (get apps target)]
|
||||
(if target-fn
|
||||
(apply target-fn [config])
|
||||
(println "target" target "not found"))))
|
||||
Reference in new issue
Block a user