speculator: Add /healthz endpoint
This commit is contained in:
parent
708f281270
commit
ca7dd49dc6
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue