added health check endpoint
This commit is contained in:
parent
88504143be
commit
1153b3515f
@ -64,6 +64,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.RequestURI == "/health" {
|
||||||
|
http.Error(w, "OK", http.StatusOK)
|
||||||
|
return
|
||||||
|
}
|
||||||
r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req))
|
r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
Loading…
Reference in New Issue
Block a user