Files
greenlight/cmd/api/healthcheck.go
lbenedar b8fff8f7d5 ch10.1
2026-03-19 13:44:50 +03:00

20 lines
380 B
Go

package main
import (
"net/http"
)
func (app *application) healthcheckHandler(w http.ResponseWriter, r *http.Request) {
env := envelope{
"status": "available",
"system_info": map[string]string{
"environment": app.config.env,
"version": version,
},
}
err := app.writeJSON(w, http.StatusOK, env, nil)
if err != nil {
app.serverErrorResponse(w, r, err)
}
}