From dc531ba2efd15c71141ee943d4cd06f53f9be00e Mon Sep 17 00:00:00 2001 From: toir-bot Date: Sat, 25 Apr 2026 13:35:10 +0000 Subject: [PATCH] chore: initial project scaffold: backend/src/main.ts --- backend/src/main.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 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..daff589 --- /dev/null +++ b/backend/src/main.ts @@ -0,0 +1,25 @@ +import { NestFactory } from '@nestjs/core'; +import { ValidationPipe } from '@nestjs/common'; +import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; +import { AppModule } from './app.module'; +import { NormalizeDatesInterceptor } from './common/normalize-dates.interceptor'; + +async function bootstrap() { + const app = await NestFactory.create(AppModule); + + app.useGlobalInterceptors(new NormalizeDatesInterceptor()); + app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); + app.enableCors(); + + const config = new DocumentBuilder() + .setTitle('toir-light-v2 API') + .setDescription('Auto-generated CRUD API for toir-light-v2') + .setVersion('1.0') + .addBearerAuth() + .build(); + const document = SwaggerModule.createDocument(app, config); + SwaggerModule.setup('api/docs', app, document); + + await app.listen(3000); +} +bootstrap();