better health check.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user