added health check endpoint
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2023-07-15 19:36:00 +02:00
parent 88504143be
commit 1153b3515f

View File

@ -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)