better health check.

This commit is contained in:
Bryce Covert
2020-09-17 07:05:23 -07:00
parent 80efc14d3a
commit 2e18e2da26
11 changed files with 88 additions and 190 deletions

View File

@@ -14,14 +14,19 @@
[mount.core :as mount])
(:gen-class))
(defn add-shutdown-hook! [^Runnable f]
(.addShutdownHook (Runtime/getRuntime)
(Thread. f)))
(mount/defstate port :start (Integer/parseInt (or (env :port) "3000")))
(mount/defstate jetty
:start (run-jetty app {:port port :join? false})
:stop (.stop jetty)
)
:stop (.stop jetty))
(defn shutdown-mount []
(mount/stop))
(defn -main [& args]
(add-shutdown-hook! shutdown-mount)
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
(mount/start))