aboutsummaryrefslogtreecommitdiff
path: root/env/dev/clj/queue_api
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2018-02-17 13:55:55 -0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2018-02-17 13:55:55 -0200
commit98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa (patch)
tree61f453e1b21634e0f2d740ff61091d182e145184 /env/dev/clj/queue_api
downloadqueue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.tar.gz
queue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.tar.bz2
queue-api-98056e815a6dcd36d7377d3cd823a4aaf5a3d9fa.zip
Initial commit
Diffstat (limited to 'env/dev/clj/queue_api')
-rw-r--r--env/dev/clj/queue_api/dev_middleware.clj10
-rw-r--r--env/dev/clj/queue_api/env.clj14
2 files changed, 24 insertions, 0 deletions
diff --git a/env/dev/clj/queue_api/dev_middleware.clj b/env/dev/clj/queue_api/dev_middleware.clj
new file mode 100644
index 0000000..ece7a25
--- /dev/null
+++ b/env/dev/clj/queue_api/dev_middleware.clj
@@ -0,0 +1,10 @@
+(ns queue-api.dev-middleware
+ (:require [ring.middleware.reload :refer [wrap-reload]]
+ [selmer.middleware :refer [wrap-error-page]]
+ [prone.middleware :refer [wrap-exceptions]]))
+
+(defn wrap-dev [handler]
+ (-> handler
+ wrap-reload
+ wrap-error-page
+ wrap-exceptions))
diff --git a/env/dev/clj/queue_api/env.clj b/env/dev/clj/queue_api/env.clj
new file mode 100644
index 0000000..1f31ba5
--- /dev/null
+++ b/env/dev/clj/queue_api/env.clj
@@ -0,0 +1,14 @@
+(ns queue-api.env
+ (:require [selmer.parser :as parser]
+ [clojure.tools.logging :as log]
+ [queue-api.dev-middleware :refer [wrap-dev]]))
+
+(def defaults
+ {:init
+ (fn []
+ (parser/cache-off!)
+ (log/info "\n-=[queue-api started successfully using the development profile]=-"))
+ :stop
+ (fn []
+ (log/info "\n-=[queue-api has shut down successfully]=-"))
+ :middleware wrap-dev})