Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/cannedHTTPResponses

Index

Functions

badRequest

  • badRequest(res: Response, detail?: string | {}): void
  • Terminates a request with status code 400, default message field and optional detail string.

    Parameters

    • res: Response

      Express response object.

    • Optional detail: string | {}

      Optional string or object wiht extra details.

    Returns void

internalServerError

  • internalServerError(res: Response, detail?: string | {}): void
  • Terminates a request with status code 500, default message field and optional detail string.

    Parameters

    • res: Response

      Express response object.

    • Optional detail: string | {}

      Optional string or object wiht extra details.

    Returns void

notFound

  • notFound(res: Response, detail?: string | {}): void
  • Terminates a request with status code 404, default message field and optional detail string.

    Parameters

    • res: Response

      Express response object.

    • Optional detail: string | {}

      Optional string or object wiht extra details.

    Returns void

ok

  • ok(res: Response, detail?: string | {}): void
  • Terminates a request with status code 200, default message field and optional detail string.

    Parameters

    • res: Response

      Express response object.

    • Optional detail: string | {}

      Optional string or object wiht extra details.

    Returns void

unauthorized

  • unauthorized(res: Response, detail?: string | {}): void
  • Terminates a request with status code 401, default message field and optional detail string.

    Parameters

    • res: Response

      Express response object.

    • Optional detail: string | {}

      Optional string or object wiht extra details.

    Returns void

Generated using TypeDoc