| 12345678910111213141516171819 |
- import { NestFactory } from '@nestjs/core';
- import { AppController } from './app.controller';
- import { AppModule } from './app.module';
- async function bootstrap() {
- const app = await NestFactory.create(AppModule);
- // Enable CORS for WebSocket connections
- app.enableCors();
- // Set app instance on controller for restart functionality
- const appController = app.get(AppController);
- appController.setApp(app);
- 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();
|