Skip to main content

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

NameTypeDescription
responseBodyanyThe result body
mimeTypestringMIME type of the body content
headersRecord<string, any>?The result headers

Example usage

const { http } = Melon;
const html = () => http.static(200, "<a>Hello World!</a>", "text/html");