Files
prism/backend/src/main.ts

19 lines
654 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// Настройка CORS для работы с фронтендом
app.enableCors({
origin: true, // В разработке разрешаем все источники
credentials: true,
allowedHeaders: ['Content-Type', 'Authorization'],
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
});
await app.listen(process.env.PORT ?? 3000);
console.log(`Application is running on: http://localhost:${process.env.PORT ?? 3000}/graphql`);
}
bootstrap();