Files
gitmost/server/src/main.ts
Philipinho 2e9969d590 socket.io server init
* Make Hocuspocus collaboration websocket server (wsAdapter) work with socket.io
* Create database module for TypeOrm
2023-10-16 15:19:30 +01:00

33 lines
827 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.enableCors();
app.useGlobalInterceptors(new TransformHttpResponseInterceptor());
app.enableShutdownHooks();
await app.listen(process.env.PORT || 3001);
}
bootstrap();