mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-22 01:08:37 +01:00
speculator: Add /healthz endpoint
This commit is contained in:
parent
708f281270
commit
ca7dd49dc6
|
|
@ -220,5 +220,12 @@ func main() {
|
||||||
}
|
}
|
||||||
http.HandleFunc("/spec/", serveSpec)
|
http.HandleFunc("/spec/", serveSpec)
|
||||||
http.HandleFunc("/diff/rst/", serveRstDiff)
|
http.HandleFunc("/diff/rst/", serveRstDiff)
|
||||||
|
http.HandleFunc("/healthz", serveText("ok"))
|
||||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), nil))
|
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func serveText(s string) func(http.ResponseWriter, *http.Request) {
|
||||||
|
return func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
io.WriteString(w, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue