Add health check and retry logic and circuit breaker

This commit is contained in:
SepehrYahyaee
2026-09-28 17:01:53 +03:30
parent 22371f4a03
commit 03fa5e0f20
67 changed files with 3101 additions and 410 deletions
+6 -1
View File
@@ -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);