mirror of
https://github.com/penpot/penpot.git
synced 2025-07-14 07:07:58 +02:00
🎉 Add /readyz http endpoint for backend & exporter
This commit is contained in:
parent
36f30c611e
commit
028e0c5b70
6 changed files with 51 additions and 35 deletions
|
@ -124,6 +124,16 @@
|
|||
(let [token (.get ^js cookies cookie-name)]
|
||||
(handler (cond-> exchange token (assoc :request/auth-token token))))))
|
||||
|
||||
(defn- wrap-health
|
||||
"Add /healthz entry point intercept."
|
||||
[handler]
|
||||
(fn [{:keys [:request/path] :as exchange}]
|
||||
(if (= path "/readyz")
|
||||
(assoc exchange
|
||||
:response/status 200
|
||||
:response/body "OK")
|
||||
(handler exchange))))
|
||||
|
||||
(defn- create-adapter
|
||||
[handler]
|
||||
(fn [req res]
|
||||
|
@ -149,6 +159,7 @@
|
|||
(defn init
|
||||
[]
|
||||
(let [handler (-> handlers/handler
|
||||
(wrap-health)
|
||||
(wrap-auth "auth-token")
|
||||
(wrap-response-format)
|
||||
(wrap-params)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue