Skip to content
Snippets Groups Projects
  • Konstantin Tsabolov's avatar
    7f3815fd
    chore: update dependencies, fix style · 7f3815fd
    Konstantin Tsabolov authored
    * Upgraded the dependencies to the latest versions
    * Switched output to ESM format
    * Switched NestJS and Jest to SWC to improve speed of building and testing
    * Refactored TSConfig to remove tsconfig-paths
    * Updated imports in all files to reflect the change in TSConfig
    * Changed the linting rules (removed AirBnB config)
    * Fixed Prettier installation (added ignore file)
    * Fixed typing errors (mainly usage of any's)
    * Fixed the non-working E2E test
    
    P.S. None of the mentioned makes sense alone, therefore a huge commit :man_shrugging:
    chore: update dependencies, fix style
    Konstantin Tsabolov authored
    * Upgraded the dependencies to the latest versions
    * Switched output to ESM format
    * Switched NestJS and Jest to SWC to improve speed of building and testing
    * Refactored TSConfig to remove tsconfig-paths
    * Updated imports in all files to reflect the change in TSConfig
    * Changed the linting rules (removed AirBnB config)
    * Fixed Prettier installation (added ignore file)
    * Fixed typing errors (mainly usage of any's)
    * Fixed the non-working E2E test
    
    P.S. None of the mentioned makes sense alone, therefore a huge commit :man_shrugging:
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
health.controller.ts 1.06 KiB
import { Controller, Get, HttpStatus, Version } from '@nestjs/common';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import type ResponseType from '../common/response.js';

@Controller('health')
export default class HealthController {
  res: ResponseType;

  @Version(['1'])
  @Get()
  @ApiOperation({
    summary: 'Health check',
    description:
      'This call provides the capability to check the service is working and up. The call returns 200 Status Code and current server time in json body',
  })
  @ApiResponse({
    status: HttpStatus.OK,
    description: 'Service is up and running.',
    content: {
      'application/json': {
        schema: {},
        examples: {
          'Service is up and running.': {
            value: {
              statusCode: 200,
              message:
                'Thu Jan 01 1970 00:00:00 GMT+0000 (Coordinated Universal Time)',
            },
          },
        },
      },
    },
  })
  getHealth() {
    this.res = {
      statusCode: HttpStatus.OK,
      message: `${new Date()}`,
    };
    return this.res;
  }
}