node_test
    Preparing search index...

    Class JsonResponse

    JsonResponse

    A helper class for creating JSON responses.

    Index

    Methods

    • Parameters

      • data: any

        The data to send in the response.

      Returns this

      The JsonResponse instance.

      body

      Sets the body of the response.

    • Parameters

      • status: number

        The status code.

      Returns this

      The JsonResponse instance.

      status

      Sets the status code of the response.

    • Parameters

      • res: ServerResponse

        The server response object.

      Returns JsonResponse

      A new JsonResponse instance.

      for

      Creates a new JsonResponse instance.