import { NestFactory } from '@nestjs/core'; import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'; import { ValidationPipe } from '@nestjs/common'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create( AppModule, new FastifyAdapter({ logger: true }) ); // Enable CORS app.enableCors({ origin: process.env.FRONTEND_URL || 'http://localhost:3000', credentials: true, }); // Global validation pipe app.useGlobalPipes( new ValidationPipe({ whitelist: true, transform: true, }) ); const port = process.env.PORT || 5050; await app.listen(port, '0.0.0.0'); console.log(`🚀 wexts API running on http://localhost:${port}`); } bootstrap();