diff --git a/src/app.controller.ts b/src/app.controller.ts index 18d5bf7..470a286 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,14 +1,20 @@ import { Controller, Get } from '@nestjs/common'; -import { AppService } from './app.service'; -import { ApiExcludeEndpoint } from '@nestjs/swagger'; +import { ApiTags, ApiOperation } from '@nestjs/swagger'; +import { APP_VERSION } from './version'; -@Controller() +@ApiTags('Main') +@Controller('v1') export class AppController { - constructor(private readonly appService: AppService) {} - - @Get() - @ApiExcludeEndpoint() - getHello(): string { - return this.appService.getHello(); + @Get('version') + @ApiOperation({ summary: 'Get App Version' }) + getVersion() { + return { version: APP_VERSION }; } + + @Get('health') +@ApiOperation({ summary: 'Health check' }) +healthCheck() { + return { status: 'ok' }; +} + } diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..55821d1 --- /dev/null +++ b/src/version.ts @@ -0,0 +1 @@ +export const APP_VERSION = 'v1.1.0'; diff --git a/vendaweb-api.rar b/vendaweb-api.rar deleted file mode 100644 index 21f5445..0000000 Binary files a/vendaweb-api.rar and /dev/null differ