2026-05-25 15:36:49 +03:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"warpbox.dev/backend/libs/helpers"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type healthResponse struct {
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
Time string `json:"time"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *App) Health(w http.ResponseWriter, r *http.Request) {
|
2026-06-02 11:54:38 +03:00
|
|
|
if r.URL.Path != "/health" {
|
|
|
|
|
http.NotFound(w, r)
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-05-25 15:36:49 +03:00
|
|
|
helpers.WriteJSON(w, http.StatusOK, healthResponse{
|
|
|
|
|
Status: "ok",
|
|
|
|
|
Time: time.Now().UTC().Format(time.RFC3339),
|
|
|
|
|
})
|
|
|
|
|
}
|