check / check (push) Successful in 3m34s
fx wrote its own steps of starting and stopping as plain text to stderr. It now logs them with its slog event logger through the backend's logger, so off a terminal every line the backend's own logger and fx write is JSON. A malformed config file now makes config.New return the error instead of panicking. A test runs the server as a child process and checks that all it writes is JSON, on a normal start and stop and with such a config file. The backend logs its name, version and architecture once at start. The health check's uptime keys are now uptime_seconds and uptime_human; its type and method take the names GO_HTTP_SERVER_CONVENTIONS.md gives. Model: opus-5-5
12 lines
285 B
Go
12 lines
285 B
Go
package handlers
|
|
|
|
import "net/http"
|
|
|
|
// HandleHealthCheck returns a handler for the health check
|
|
// endpoint.
|
|
func (s *Handlers) HandleHealthCheck() http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
s.respondJSON(w, r, s.hc.Healthcheck(), http.StatusOK)
|
|
}
|
|
}
|