* Make Hocuspocus collaboration websocket server (wsAdapter) work with socket.io * Create database module for TypeOrm
33 lines
827 B
TypeScript
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();
|