Skip to content

Type Alias: HTTPEntrypointHandler<T> ​

HTTPEntrypointHandler<T> = (context, abortController?) => Promise<T>

Dispatch an HTTP request to the action of its route and method, given to an HTTPEntrypoint. The promise resolves to the action's result; it rejects with a ControllerActionNotFoundException when no action matches, and with the error of the input validation, the access control or the action. Aborting the controller cancels the request: its result is dropped and the promise resolves to undefined; a request aborted before it starts is not run at all.

Type Parameters ​

T ​

T = unknown

Parameters ​

context ​

HTTPContext

The request: its route, method, data (the input of the action), request and response.

abortController? ​

AbortController

Aborts the request, for example when its connection closes.

Returns ​

Promise<T>

The action's result.

Released under the MIT License.