Untitled

mail@pastecode.io avatar
unknown
golang
3 years ago
486 B
2
Indexable
Never
// Declare a handler which writes a plain-text response with information about the
// application status, operating environment and version.
func (app *application) healthcheckHandler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "status: available")
	fmt.Fprintf(w, "environment: %s\n", app.config.env)
	fmt.Fprintf(w, "version: %s\n", version)

	fmt.Fprintf(w, "haleala: %s \n", app.config.haleala)
	fmt.Fprintf(w, "cati cozonaci ai halit %d \n", app.config.nrCozonaci)
}