import { NestFactory } from "@nestjs/core"; import { AppModule } from "./app.module"; async function bootstrap() { const app = await NestFactory.create(AppModule); app.enableCors(); const port = process.env["PORT"] ?? 3001; await app.listen(port); console.log(`API running on http://localhost:${port}`); } bootstrap().catch((err: unknown) => { console.error("Failed to start application:", err); process.exit(1); });