Files
2025-04-24 22:09:10 +02:00

18 lines
318 B
Go

package api
import (
"net/http"
)
func (s *Server) healthHandler(w http.ResponseWriter, r *http.Request) {
if s.healthy() {
w.WriteHeader(http.StatusOK)
} else {
w.WriteHeader(http.StatusInternalServerError)
}
}
func (s *Server) healthy() bool {
return len(s.state.Stack) > 0 && s.state.Stack[0].Success
}