Browse Source

Replaced configuration with simple 12-factor approach, and...

Also removed extraneous test code.
master
Stephen Starkey 2 years ago
parent
commit
99f131498c
  1. 2
      project.clj
  2. 11
      src/clj/email_counter/config.clj
  3. 2
      test/clj/email_counter/test/handler.clj

2
project.clj

@ -7,7 +7,7 @@
[cheshire "5.8.1"]
[clojure.java-time "0.3.2"]
[com.sun.mail/javax.mail "1.6.0"]
[cprop "0.1.14"]
[coreagile/defenv "1.0.4"]
[expound "0.7.2"]
[funcool/struct "1.4.0"]
[javax.mail/javax.mail-api "1.6.2"]

11
src/clj/email_counter/config.clj

@ -1,13 +1,10 @@
(ns email-counter.config
(:require
[cprop.core :refer [load-config]]
[cprop.source :as source]
[defenv.core :as env]
[mount.core :refer [args defstate]]))
(defstate env
:start
(load-config
:merge
[(args)
(source/from-system-props)
(source/from-env)]))
(env/env->map {:port {:env-name "PORT"
:tfn env/parse-int
:default "3000"}}))

2
test/clj/email_counter/test/handler.clj

@ -66,5 +66,3 @@
(testing "no exceptions were actually encountered"
(is (= 0 (count @exceptions-encountered))
(print-exceptions))))))
(clojure.test/run-tests)
Loading…
Cancel
Save