Page Contents
Home > @loopback/rest > DefaultSequence > handle
DefaultSequence.handle() method
Runs the default sequence. Given a handler context (request and response), running the sequence will produce a response or an error.
Default sequence executes these steps - Executes middleware for CORS, OpenAPI spec endpoints - Finds the appropriate controller method, swagger spec and args for invocation - Parses HTTP request to get API argument list - Invokes the API which is defined in the Application Controller - Writes the result from API into the HTTP response - Error is caught and logged using ‘logError’ if any of the above steps in the sequence fails with an error.
Signature:
handle(context: RequestContext): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
context | RequestContext | The request context: HTTP request and response objects, per-request IoC container and more. |
Returns:
Promise<void>