Files
seshat/backend/nestjs-seshat-api/src/main.ts

20 lines
655 B
TypeScript

import * as cookieParser from 'cookie-parser';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
import { Logger, LoggerErrorInterceptor } from 'nestjs-pino';
async function bootstrap() {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.use(cookieParser());
app.useGlobalPipes(new ValidationPipe({
stopAtFirstError: true,
whitelist: true,
transform: true,
}));
app.useLogger(app.get(Logger));
app.useGlobalInterceptors(new LoggerErrorInterceptor());
await app.listen(process.env.WEB_API_PORT ?? 3001);
}
bootstrap();