package statuspage import ( "net/http" "nexavpn/backend/internal/apiutil" ) type Handler struct { service *Service } func NewHandler(service *Service) *Handler { return &Handler{service: service} } func (h *Handler) PublicStatus(w http.ResponseWriter, r *http.Request) { snapshot := h.service.Snapshot(r.Context()) statusCode := http.StatusOK if snapshot.Status != "operational" { statusCode = http.StatusServiceUnavailable } apiutil.JSON(w, statusCode, snapshot) }