/
range
/
stock
Обзор
Документация
Войти
/
range
/
stock
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/src/main.ts
37 строк
1 KB
Range18
Shedevro commit
23 ноя 2025, 09:15
23 ноя 2025, 09:15
59bb6f3
Код
Авторство
О чём код?
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { ValidationPipe } from '@nestjs/common'; import { HttpExceptionFilter } from './common/filters/http-exception.filter'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalPipes( new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true, }), ); app.enableCors({ origin: ['http://192.168.124.229:1611', 'http://localhost:1611'], methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', credentials: true, }); app.useGlobalFilters(new HttpExceptionFilter()); const config = new DocumentBuilder() .setTitle('Courses API') .setDescription('API для управления курсами') .setVersion('1.0') .build(); const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup('api', app, document); await app.listen(2398, '0.0.0.0'); } bootstrap();