Variable: Result
constResult:object
Build the results an action returns to describe its output beyond its data.
Type Declaration
events
events: (
producer) =>EventsResult
Build an event stream result (Server-Sent Events for HTTP).
Parameters
producer
Produces the events, after the action returned.
Returns
The EventsResult.
file
file: (
source,options?) =>FileResult
Build a file result.
Parameters
source
string | Buffer | Readable
The file's path (resolved from the working directory), its content, or a stream of its content.
options?
How the file is sent.
Returns
The FileResult.
status
status: (
status,data?,headers?) =>StatusResult
Build a result with a status and headers.
Parameters
status
number
The HTTP status.
data?
unknown
The data sent.
headers?
Record<string, string>
The response headers.
Returns
The StatusResult.