feat: add api liveness and readiness checks
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { RequestMethod } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { ApiModule } from './api.module';
|
||||
|
||||
export async function bootstrapApi(): Promise<void> {
|
||||
const app = await NestFactory.create(ApiModule);
|
||||
app.enableShutdownHooks();
|
||||
app.setGlobalPrefix('api/v1');
|
||||
app.setGlobalPrefix('api/v1', {
|
||||
exclude: [
|
||||
{ path: 'health/live', method: RequestMethod.GET },
|
||||
{ path: 'health/ready', method: RequestMethod.GET },
|
||||
],
|
||||
});
|
||||
await app.listen(3000, '0.0.0.0');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user