From 224d7f40ed4699d1061de6d83208c49a3f852b0a Mon Sep 17 00:00:00 2001 From: James Read Date: Fri, 6 Jun 2025 17:02:00 +0100 Subject: [PATCH] feat: Add unauthenticated readyz endpoint (#600) --- service/internal/httpservers/singleFrontend.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/internal/httpservers/singleFrontend.go b/service/internal/httpservers/singleFrontend.go index 66626c2..0dcaecf 100644 --- a/service/internal/httpservers/singleFrontend.go +++ b/service/internal/httpservers/singleFrontend.go @@ -60,6 +60,8 @@ func StartSingleHTTPFrontend(cfg *config.Config) { mux.HandleFunc("/oauth/callback", handleOAuthCallback) + mux.HandleFunc("/readyz", handleReadyz) + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { logDebugRequest(cfg, "ui ", r) @@ -86,3 +88,9 @@ func StartSingleHTTPFrontend(cfg *config.Config) { 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")) +}