mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 13:11:02 +00:00
feat(api): enable global ValidationPipeline
This commit is contained in:
parent
c9030937e2
commit
ddcdfff89b
1 changed files with 7 additions and 0 deletions
|
|
@ -2,9 +2,16 @@ import { NestFactory } from "@nestjs/core";
|
|||
import { NestExpressApplication } from "@nestjs/platform-express";
|
||||
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
|
||||
import { AppModule } from "./app.module";
|
||||
import { ValidationPipe } from "@nestjs/common";
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
transform: true,
|
||||
transformOptions: { enableImplicitConversion: true },
|
||||
})
|
||||
);
|
||||
app.enableShutdownHooks();
|
||||
|
||||
// Setup API Docs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue