import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // Enable CORS for WebSocket connections
  app.enableCors();

  const port = process.env.PORT ? Number(process.env.PORT) : 3001;
  console.log(`Starting API service with WebSocket support on port ${port}`);
  await app.listen(port);
}
bootstrap();
