Melon.http.static(responseBody, mimeType, responseHeaders?)
Creates a result object with a static content, response body and headers to be used as result of a http application endpoint.
Status: stable
Returns: HttpResult
Parameters
Name | Type | Description |
---|---|---|
responseBody | any | The result body |
mimeType | string | MIME type of the body content |
headers | Record<string, any>? | The result headers |
Example usage
const { http } = Melon;
const html = () => http.static(200, "<a>Hello World!</a>", "text/html");