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) {
	helpers.WriteJSON(w, http.StatusOK, healthResponse{
		Status: "ok",
		Time:   time.Now().UTC().Format(time.RFC3339),
	})
}
