mirror of
https://github.com/penpot/penpot.git
synced 2025-05-20 07:06:13 +02:00
🐛 Fix metrics and doc endpoints
This commit is contained in:
parent
408de63ea3
commit
08c6ebe10c
2 changed files with 9 additions and 9 deletions
|
@ -89,12 +89,12 @@
|
||||||
|
|
||||||
|
|
||||||
(defn- handler
|
(defn- handler
|
||||||
[registry _ respond _]
|
[registry _]
|
||||||
(let [samples (.metricFamilySamples ^CollectorRegistry registry)
|
(let [samples (.metricFamilySamples ^CollectorRegistry registry)
|
||||||
writer (StringWriter.)]
|
writer (StringWriter.)]
|
||||||
(TextFormat/write004 writer samples)
|
(TextFormat/write004 writer samples)
|
||||||
(respond {:headers {"content-type" TextFormat/CONTENT_TYPE_004}
|
{:headers {"content-type" TextFormat/CONTENT_TYPE_004}
|
||||||
:body (.toString writer)})))
|
:body (.toString writer)}))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,12 +65,12 @@
|
||||||
[methods]
|
[methods]
|
||||||
(if (contains? cf/flags :backend-api-doc)
|
(if (contains? cf/flags :backend-api-doc)
|
||||||
(let [context (prepare-context methods)]
|
(let [context (prepare-context methods)]
|
||||||
(fn [_ respond _]
|
(fn [_]
|
||||||
(respond {::yrs/status 200
|
{::yrs/status 200
|
||||||
::yrs/body (-> (io/resource "app/templates/api-doc.tmpl")
|
::yrs/body (-> (io/resource "app/templates/api-doc.tmpl")
|
||||||
(tmpl/render context))})))
|
(tmpl/render context))}))
|
||||||
(fn [_ respond _]
|
(fn [_]
|
||||||
(respond {::yrs/status 404}))))
|
{::yrs/status 404})))
|
||||||
|
|
||||||
(s/def ::routes vector?)
|
(s/def ::routes vector?)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue