package api

import (
	"net/http"
	"party.at/party/cmd/party/common"
)

func (api *Api) Healthcheck(w http.ResponseWriter, r *http.Request) {
	env := common.Envelope{
		"status": "available",
		"system_info": map[string]string{
			"environment": api.App.Config.Env,
			"version":     "1",
		},
	}

	if err := common.WriteJSON(w, http.StatusOK, common.Envelope{"health_check": env}, nil); err != nil {
		api.ServerErrorResponse(w, r, err)
	}
}
