Skip to main content

DefaultNetwork

@h4ad/serverless-adapter > DefaultNetwork

(class) DefaultNetwork

The default network implementation used to create framework request and response objects.

Signature:

export declare class DefaultNetwork implements NetworkContract<ServerlessRequest, ServerlessResponse> 

Implements: NetworkContract <ServerlessRequest , ServerlessResponse >

(constructor)

Constructs a new instance of the DefaultNetwork class

Signature:

constructor(options?: DefaultNetworkOptions);

Parameters

Parameter

Type

Description

options

DefaultNetworkOptions

(Optional)

(method) createRequest

Signature:

createRequest(props: ServerlessRequestProps): ServerlessRequest;

Parameters

Parameter

Type

Description

props

ServerlessRequestProps

Returns:

ServerlessRequest

(method) createResponse

Signature:

createResponse(props: \{
method?: string;
}): ServerlessResponse;

Parameters

Parameter

Type

Description

props

{ method?: string; }

Returns:

ServerlessResponse

(method) getResponseBody

Signature:

getResponseBody(response: ServerlessResponse): Buffer;

Parameters

Parameter

Type

Description

response

ServerlessResponse

Returns:

Buffer

(method) getResponseHeaders

Signature:

getResponseHeaders(response: ServerlessResponse): import("http").OutgoingHttpHeaders & Record<any, any>;

Parameters

Parameter

Type

Description

response

ServerlessResponse

Returns:

import("http").OutgoingHttpHeaders & Record<any, any>