EdgeResponse
The EdgeResponse
class is a wrapper around the Response
class to make it easier to use.
Reference: MDN Web API Reference - Response
Installation
Simple Usage
API Reference
Functions
API Reference
EdgeResponse
A class representing an Edge response with methods for setting status, headers, and sending different types of responses.
Methods
constructor()
: Creates a new EdgeResponse instance with default values.status(status: number): EdgeResponse
: Sets the status code of the response and returns the EdgeResponse instance.headers(headers: Record<string, string>): EdgeResponse
: Sets the headers of the response and returns the EdgeResponse instance.json(body: unknown): Response
: Sends a JSON response with the provided body and current status code and headers.text(body: string): Response
: Sends a text response with the provided body and current status code and headers.send(body: unknown): Response
: Sends a custom response with the provided body and current status code and headers.end(): Response
: Ends the response with the current body and headers.