forked from Shared/esg
Add health check and retry logic and circuit breaker
This commit is contained in:
+6
-1
@@ -3,7 +3,8 @@ import { Logger, ValidationPipe } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { NextFunction, Request, Response, static as serveStatic } from 'express';
|
||||
import { join } from 'node:path';
|
||||
import { AppModule } from './app.module';
|
||||
import { API_KEY_HEADER } from './common/constants/app.constants';
|
||||
import { OpenTelemetryNestLogger } from './otel-nest-logger';
|
||||
@@ -20,6 +21,10 @@ async function bootstrap(): Promise<void> {
|
||||
Logger.overrideLogger(logger);
|
||||
|
||||
const app = await NestFactory.create(AppModule, { logger });
|
||||
app.enableShutdownHooks();
|
||||
const httpServer = app.getHttpAdapter().getInstance();
|
||||
httpServer.use('/dashboard', serveStatic(join(__dirname, 'public')));
|
||||
httpServer.get('/', (_request: Request, response: Response) => response.redirect('/dashboard/'));
|
||||
const configService = app.get(ConfigService);
|
||||
const port = configService.get<number>('app.port', 8085);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user