proteje rotas com JwtAuthGuard e documenta endpoints com Swagger

This commit is contained in:
unknown
2025-03-28 19:46:44 -03:00
parent 36aea127c1
commit 5e4ef04b4a
20 changed files with 372 additions and 66 deletions

View File

@@ -1,11 +1,20 @@
/* eslint-disable prettier/prettier */
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
}),
);
app.enableCors({
origin: '*',
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
@@ -23,6 +32,7 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('docs', app, document);
await app.listen(9009);
await app.listen(9001);
}
bootstrap();