3
0

Improve HTTP server startup, add wrapping handler

HTTP server now initializes much earlier and mounts "waiting"
router with debugging, version and health check routes.

When server is fully activated it switches to "active"
router.

Shutdown stage is also handled with catch-all route.
This commit is contained in:
Denis Arh
2022-02-12 16:38:32 +01:00
parent 330a332fdd
commit 2082908f39

View File

@@ -61,6 +61,7 @@ func shutdownRoutes() (r chi.Router) {
w.Header().Set("Refresh", "15; url=/")
_, _ = fmt.Fprint(w, "corteza server shutting down")
})
return
}