Class: ServerResponseMiddleware
Class: ServerResponseMiddleware
Middleware for handling server responses and transforming them into the appropriate HTTP responses.
This middleware processes outgoing responses and attaches the necessary headers, status codes, and body content to the HTTP response.
Constructors
Constructor
new ServerResponseMiddleware(): ServerResponseMiddleware;
Returns
ServerResponseMiddleware
Methods
handle()
handle(context, next): Promise<AwsLambdaHttpAdapterResponseBuilder>;
Handles the outgoing response, processes it, and invokes the next middleware in the pipeline.
Parameters
context
The adapter context containing the raw event, execution context, and other data.
next
NextMiddleware
<AwsLambdaHttpAdapterContext
, AwsLambdaHttpAdapterResponseBuilder
>
The next middleware to be invoked in the pipeline.
Returns
Promise
<AwsLambdaHttpAdapterResponseBuilder
>
A promise resolving to the rawResponseBuilder.
Throws
If required components are missing in the context.