Add /-/healthy endpoint

This commit is contained in:
Simon Pasquier 2017-12-21 12:29:38 +01:00
parent 6fa697ae17
commit e8661f5768
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ package ui
import (
"bytes"
"fmt"
"io"
"net/http"
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
@ -76,6 +77,11 @@ func Register(r *route.Router, reloadCh chan<- struct{}, logger log.Logger) {
reloadCh <- struct{}{}
})
r.Get("/-/healthy", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "OK")
})
r.Get("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
r.Post("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
}