애플리케이션에서 사용한 코드 및 환경

Nest.js, TypeScript

 

app.servicr.ts

import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
  getHealthCheck(): string {
    return 'Success Health Check';
  }
}

 

app.controller.ts

import { Controller, Get, HttpCode } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get('/health')
  @HttpCode(200)
  getHealthCheck(): string {
    return this.appService.getHealthCheck();
  }
}

+ Recent posts