chore: add http logger and core interceptors
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user