Added versioning for the /papers controller

This commit is contained in:
danny-mhlv 2022-08-16 16:57:56 +03:00
parent 78de638645
commit da564323a0
2 changed files with 9 additions and 2 deletions

View File

@ -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) {}

View File

@ -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
*/