test apps api
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
import 'reflect-metadata'; // For NestJS DI (before any other imports)
|
||||
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { writeFileSync } from 'fs';
|
||||
@@ -10,6 +11,14 @@ import { AppModule } from './app.module';
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule, process.env.GENERATE_OPENAPI ? { logger: false } : undefined);
|
||||
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
transform: true,
|
||||
}),
|
||||
);
|
||||
|
||||
// Swagger/OpenAPI configuration
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('GridPilot API')
|
||||
|
||||
Reference in New Issue
Block a user