BaseApiContext: { authentication?: Authentication; badRequest: ((message?: string) => void); internalServerError: ((message?: string) => void); req: IncomingMessage; respond: ((status: number, message: string) => void) }

Base of the "Closure" value passed to all endpoint definitions, providing additional context about the caller

Type declaration

  • Optional authentication?: Authentication

    Parsed authentication data sent with the request

  • badRequest: ((message?: string) => void)
      • (message?: string): void
      • Helper function for responding with a standardized BAD_REQUEST object with a default message

        Parameters

        • Optional message: string

        Returns void

  • internalServerError: ((message?: string) => void)
      • (message?: string): void
      • Helper function for responding with a standardized INTERNAL_SERVER_ERROR object with a default message

        Parameters

        • Optional message: string

        Returns void

  • req: IncomingMessage

    The raw underlying http IncomingMessage

  • respond: ((status: number, message: string) => void)
      • (status: number, message: string): void
      • Helper function for responding with arbitrary messages and statuses (status ignored for WS comms)

        Parameters

        • status: number
        • message: string

        Returns void

Generated using TypeDoc