Files
tvone-api/src/main.ts
T
2026-04-17 13:34:57 +01:00

15 lines
460 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({
origin: ["http://localhost:3000"], // 👈 array is safer
methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
allowedHeaders: ["Content-Type", "Authorization"],
credentials: true,
});
await app.listen(process.env.PORT ?? 3001);
}
bootstrap();