mirror of
https://github.com/PeterMaquiran/tvone-api.git
synced 2026-04-18 08:17:52 +00:00
15 lines
460 B
TypeScript
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();
|