diff --git a/src/application/controller/papers.controller.ts b/src/application/controller/papers.controller.ts index a251822..4aefece 100644 --- a/src/application/controller/papers.controller.ts +++ b/src/application/controller/papers.controller.ts @@ -8,7 +8,10 @@ import { RequestDto } from "src/core/domain/dtos/request.dto"; /** * /papers/ route controller */ -@Controller('papers') +@Controller({ + version: '1', + path: 'papers', +}) export class PapersController { constructor(private searchService: SearchService) {} diff --git a/src/main.ts b/src/main.ts index 5333fdb..4d8d5c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import morgan from 'morgan'; -import { Logger, ValidationPipe } from '@nestjs/common'; +import { Logger, ValidationPipe, VersioningType } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './infrastructure/modules/app.module'; import { SwaggerModule, DocumentBuilder, SwaggerDocumentOptions } from '@nestjs/swagger'; @@ -19,6 +19,10 @@ async function bootstrap() { }) ); + app.enableVersioning({ + type: VersioningType.URI, + }); + /** * Configuration of the Swagger document */