refactor(routes): Phase 3.3 - standardize health.js with explicit dependencies
- Replaced god object ctx with explicit dependency injection - Added JSDoc documenting required dependencies (8 deps vs 50+) - Updated response calls to use response-helpers (success/error) - Self-documenting: you can see exactly what this route needs - Health checks, pylon relay, CA cert validation all preserved
This commit is contained in:
@@ -1207,7 +1207,16 @@ apiRouter.use(serviceRoutes({
|
||||
caddy: ctx.caddy,
|
||||
dns: ctx.dns
|
||||
}));
|
||||
apiRouter.use(healthRoutes(ctx));
|
||||
apiRouter.use(healthRoutes({
|
||||
fetchT: ctx.fetchT,
|
||||
SERVICES_FILE: ctx.SERVICES_FILE,
|
||||
servicesStateManager: ctx.servicesStateManager,
|
||||
siteConfig: ctx.siteConfig,
|
||||
buildServiceUrl: ctx.buildServiceUrl,
|
||||
asyncHandler: ctx.asyncHandler,
|
||||
logError: ctx.logError,
|
||||
healthChecker: ctx.healthChecker
|
||||
}));
|
||||
apiRouter.use(monitoringRoutes(ctx));
|
||||
apiRouter.use(updatesRoutes(ctx));
|
||||
apiRouter.use('/tailscale', tailscaleRoutes(ctx));
|
||||
|
||||
Reference in New Issue
Block a user