From 9a4316bb13a3f9df490a46a31c2da45e152a31ea Mon Sep 17 00:00:00 2001 From: toir-bot Date: Tue, 14 Apr 2026 07:00: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..7ad54c2 --- /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('light-toir-v2 API') + .setDescription('Auto-generated CRUD API for light-toir-v2') + .setVersion('1.0') + .addBearerAuth() + .build(); + const document = SwaggerModule.createDocument(app, config); + SwaggerModule.setup('api/docs', app, document); + + await app.listen(3000); +} +bootstrap();