Skip to content

Health checks

Imports: []*dygo.Module{health.Module(health.Options{Use: []dygo.RouteOption{auth.Public()}})},
Providers: []dygo.Provider{
dygo.Provide(func(db *sql.DB) health.Indicator { return health.Ping("db", db) }, dygo.Group(health.Indicators)),
},

GET /health/live is 200 while the process runs. GET /health/ready runs every indicator (concurrently, 3 s timeout) and answers 503 if one fails or once shutdown has started. Use Options.Use to mark the routes public for your auth guard, and exclude /health from a global prefix.