File

tbl/src/app.controller.ts

Description

Application http controller

Extends

ApiResponse

Index

Methods

Methods

getHealthCheck
getHealthCheck()
Decorators :
@Get('api/health-check')

health check route

Returns : string
catchAndRespondWithError
catchAndRespondWithError(error)
Inherited from ApiResponse
Defined in ApiResponse:64

Error response method with additional trace details about error

@param message {any} - error message @param code {any} - error code

@return {AbstractApiReply} - error reply object

Parameters :
Name Optional
error No
Returns : literal type
  • error reply object
responseError
responseError(message, code)
Inherited from ApiResponse
Defined in ApiResponse:37

Error response method

@param message {any} - error message @param code {any} - error code

@return {AbstractApiReply} - error reply object

Parameters :
Name Optional Description
message No
  • error message
code No
  • error code
Returns : literal type
  • error reply object
responseSuccess
responseSuccess(data: TResponse)
Inherited from ApiResponse
Defined in ApiResponse:17
Type parameters :
  • TResponse

Success response method

@param data {any} - reply data

@return {AbstractApiReply} - success reply object

Parameters :
Name Type Optional Description
data TResponse No
  • reply data
Returns : literal type
  • success reply object
responseSuccessOnly
responseSuccessOnly()
Inherited from ApiResponse
Defined in ApiResponse:95

Simplest success response without any data method

@return {AbstractApiReply} - success reply object

Returns : literal type
  • success reply object
import { Controller, Get } from '@nestjs/common';
import { ApiResponse } from '../../shared/common/api-response';

/**
 *  Application http controller
 */
@Controller()
export class AppController extends ApiResponse {
  /**
   *  health check route
   */
  @Get('api/health-check')
  getHealthCheck(): string {
    return 'OK';
  }
}

results matching ""

    No results matching ""