From 7ebc64f8778592a8750d3f7d604e73190ec25c2a Mon Sep 17 00:00:00 2001 From: toir-bot Date: Mon, 13 Apr 2026 11:43:55 +0000 Subject: [PATCH] chore: initial project scaffold: backend/src/main.ts --- backend/src/main.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 backend/src/main.ts diff --git a/backend/src/main.ts b/backend/src/main.ts new file mode 100644 index 0000000..3e86fdb --- /dev/null +++ b/backend/src/main.ts @@ -0,0 +1,23 @@ +import { NestFactory } from '@nestjs/core'; +import { ValidationPipe } from '@nestjs/common'; +import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; +import { AppModule } from './app.module'; + +async function bootstrap() { + const app = await NestFactory.create(AppModule); + + app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); + app.enableCors(); + + const config = new DocumentBuilder() + .setTitle('test-gen-4 API') + .setDescription('Auto-generated CRUD API for test-gen-4') + .setVersion('1.0') + .addBearerAuth() + .build(); + const document = SwaggerModule.createDocument(app, config); + SwaggerModule.setup('api/docs', app, document); + + await app.listen(3000); +} +bootstrap();