From 0b9df3813991fb91b3789b37048ee842fddbdf65 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Tue, 17 Dec 2024 01:32:10 +0100 Subject: [PATCH] Ajout IoAdapter pour les websockets en production --- server/src/main.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main.ts b/server/src/main.ts index 7f7936d..7092147 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -2,11 +2,13 @@ import { NestFactory, Reflector } from '@nestjs/core' import { AppModule } from './app.module' import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger' import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common' +import { IoAdapter } from '@nestjs/platform-socket.io' async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true }) app.setGlobalPrefix(process.env.API_GLOBAL_PREFIX ?? '') + app.useWebSocketAdapter(new IoAdapter(app)) app.useGlobalPipes(new ValidationPipe({ transform: true })) app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)))