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 * /papers/ route controller
*/ */
@Controller('papers') @Controller({
version: '1',
path: 'papers',
})
export class PapersController { export class PapersController {
constructor(private searchService: SearchService) {} constructor(private searchService: SearchService) {}

View File

@ -1,5 +1,5 @@
import morgan from 'morgan'; import morgan from 'morgan';
import { Logger, ValidationPipe } from '@nestjs/common'; import { Logger, ValidationPipe, VersioningType } from '@nestjs/common';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { AppModule } from './infrastructure/modules/app.module'; import { AppModule } from './infrastructure/modules/app.module';
import { SwaggerModule, DocumentBuilder, SwaggerDocumentOptions } from '@nestjs/swagger'; import { SwaggerModule, DocumentBuilder, SwaggerDocumentOptions } from '@nestjs/swagger';
@ -19,6 +19,10 @@ async function bootstrap() {
}) })
); );
app.enableVersioning({
type: VersioningType.URI,
});
/** /**
* Configuration of the Swagger document * Configuration of the Swagger document
*/ */