chore: initial project scaffold: backend/src/main.ts

This commit is contained in:
2026-04-13 08:19:13 +00:00
parent 4a4eded3b0
commit 6e5fa4e3c5

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

@@ -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('toir-light-v-2 API')
.setDescription('Auto-generated CRUD API for toir-light-v-2')
.setVersion('1.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api/docs', app, document);
await app.listen(3000);
}
bootstrap();