chore: add http logger and core interceptors

This commit is contained in:
mahyargdz
2025-01-20 10:50:52 +03:30
parent 9701c51445
commit fb228a9f14
5 changed files with 73 additions and 24 deletions
+5
View File
@@ -5,12 +5,17 @@ import { FastifyAdapter, NestFastifyApplication } from "@nestjs/platform-fastify
import { AppModule } from "./app.module";
import { getSwaggerDocument } from "./configs/swagger.config";
import { HttpExceptionFilter } from "./core/exceptions/http.exceptions";
import { PaginationInterceptor } from "./core/interceptors/pagination.interceptor";
import { ResponseInterceptor } from "./core/interceptors/response.interceptor";
async function bootstrap() {
const logger = new Logger("APP");
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
app.useGlobalInterceptors(new ResponseInterceptor(), new PaginationInterceptor());
app.useGlobalFilters(new HttpExceptionFilter());
app.enableCors({
origin: true,