Files
greenlight/cmd/api/healthcheck.go
lbenedar 71f15d1131 ch3.6
2026-03-10 16:00:53 +03:00

21 lines
404 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.logger.Print(err)
app.serverErrorResponse(w, r, err)
}
}