Files
docmost/server/src/main.ts
T
2023-08-08 14:12:15 +01:00

31 lines
758 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import {
FastifyAdapter,
NestFastifyApplication,
} from '@nestjs/platform-fastify';
import { ValidationPipe } from '@nestjs/common';
import { TransformHttpResponseInterceptor } from './interceptors/http-response.interceptor';
async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>(
AppModule,
new FastifyAdapter({
ignoreTrailingSlash: true,
ignoreDuplicateSlashes: true,
}),
);
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
stopAtFirstError: true,
}),
);
app.useGlobalInterceptors(new TransformHttpResponseInterceptor());
await app.listen(3001);
}
bootstrap();