From 1153b3515f750d07776e4362754009c7ef4afae6 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 15 Jul 2023 19:36:00 +0200 Subject: [PATCH] added health check endpoint --- src/server/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/server.go b/src/server/server.go index 2423bcd..5b6ccd5 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -64,6 +64,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { http.Error(w, "method not allowed", http.StatusMethodNotAllowed) return } + if req.RequestURI == "/health" { + http.Error(w, "OK", http.StatusOK) + return + } r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req)) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)