Hi,
When I set the useGlobalPipes and the enableCors in the main.ts it does not work in the gateway.
I have to add it directly in the gateway file like that :
@UsePipes(new ValidationPipe({ whitelist: true }))
@WebSocketGateway({
cors: {
origin: '*',
methods: 'GET'
}
})
export class MessagesGateway {
main.ts :
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe({
whitelist: true,
}));
app.enableCors({
origin: '*',
methods: 'GET',
});
await app.listen(80);
Is that normal ?