Add a healthcheck endpoint (#48)

Signed-off-by: Quentin Gliech <quenting@element.io>
This commit is contained in:
Quentin Gliech 2022-01-21 11:37:42 +01:00 committed by GitHub
parent ff28125e8b
commit 35650109cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/48.misc Normal file
View File

@ -0,0 +1 @@
Add a /health endpoint that always replies with a 200 OK.

View File

@ -167,6 +167,10 @@ func main() {
}
http.Handle("/api/listing/", fs)
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "ok")
})
log.Println("Listening on", *bindAddr)
log.Fatal(http.ListenAndServe(*bindAddr, nil))