Revamps all of the IOL's routing, so that the new history page can share with the rest.
This commit is contained in:
19
src/clj/auto_ap/routes/health.clj
Normal file
19
src/clj/auto_ap/routes/health.clj
Normal file
@@ -0,0 +1,19 @@
|
||||
(ns auto-ap.routes.health
|
||||
(:require [mount.core :as mount]))
|
||||
|
||||
(def running? (atom false))
|
||||
|
||||
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
|
||||
(mount/defstate manage-running?
|
||||
:start (reset! running? true)
|
||||
:stop (reset! running? false))
|
||||
|
||||
(defn health-check [request]
|
||||
(if @running?
|
||||
{:status 200
|
||||
:body "Ok"}
|
||||
{:status 503
|
||||
:body "Application shut down"}))
|
||||
|
||||
(def routes {"api/" {"health-check" :health}})
|
||||
(def match->handler {:health health-check})
|
||||
Reference in New Issue
Block a user