nestjs rewrite

This commit is contained in:
popovspiridon99
2025-08-01 11:33:40 +09:00
parent 145827ab6d
commit 37bfa912a0
58 changed files with 17130 additions and 0 deletions

23
server/src/main.ts Normal file
View File

@ -0,0 +1,23 @@
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
cors: true
});
app.enableCors()
app.useGlobalPipes(new ValidationPipe({ transform: true }))
const config = new DocumentBuilder()
.setTitle('Fuel API')
.setDescription('API test')
.setVersion('0.1')
.addTag('test')
.build()
const documentFactory = () => SwaggerModule.createDocument(app, config)
SwaggerModule.setup('docs', app, documentFactory)
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();