feat: Add unauthenticated readyz endpoint (#600)

This commit is contained in:
James Read 2025-06-06 17:02:00 +01:00 committed by GitHub
parent 1357eae9b8
commit 224d7f40ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,8 @@ func StartSingleHTTPFrontend(cfg *config.Config) {
mux.HandleFunc("/oauth/callback", handleOAuthCallback) mux.HandleFunc("/oauth/callback", handleOAuthCallback)
mux.HandleFunc("/readyz", handleReadyz)
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
logDebugRequest(cfg, "ui ", r) logDebugRequest(cfg, "ui ", r)
@ -86,3 +88,9 @@ func StartSingleHTTPFrontend(cfg *config.Config) {
log.Fatal(srv.ListenAndServe()) log.Fatal(srv.ListenAndServe())
} }
func handleReadyz(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK. Single HTTP Frontend is ready.\n"))
}