fix(health): resolve 404 on /health endpoints — restructure routes under /health prefix
Root cause: HealthController used @Controller() (empty prefix) with @Get('health')
and @Get('ready') flat routes. The global prefix exclusion for 'health' and 'ready'
was unreliable for module-scoped controllers.
Changes:
- Set @Controller('health') prefix so routes are /health, /health/ready, /health/db, /health/redis
- Update global prefix exclusion to use 'health/(.*)' wildcard pattern
- Exclude health endpoints from CSRF middleware (K8s probes don't send cookies)
- Add dedicated /health/db and /health/redis endpoints per acceptance criteria
- Expand unit tests to cover all 4 health endpoints (15 tests passing)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -22,7 +22,7 @@ async function bootstrap() {
|
||||
app.setGlobalPrefix('api/v1', {
|
||||
exclude: [
|
||||
{ path: 'health', method: RequestMethod.GET },
|
||||
{ path: 'ready', method: RequestMethod.GET },
|
||||
{ path: 'health/(.*)', method: RequestMethod.GET },
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user