@h4ad/serverless-adapter
Version:
Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Azure, Digital Ocean and many other clouds.
45 lines (42 loc) • 1.12 kB
TypeScript
import { IncomingMessage } from 'node:http';
import { S as SingleValueHeaders } from './headers-DjfGHDmI.js';
/**
* The properties to create a {@link ServerlessRequest}
*
* @breadcrumb Network / ServerlessRequest
* @public
*/
interface ServerlessRequestProps {
/**
* The HTTP Method of the request
*/
method: string;
/**
* The URL requested
*/
url: string;
/**
* The headers from the event source
*/
headers: SingleValueHeaders;
/**
* The body from the event source
*/
body?: Buffer | Uint8Array;
/**
* The IP Address from caller
*/
remoteAddress?: string;
}
/**
* The class that represents an {@link http#IncomingMessage} created by the library to represent an actual request to the framework.
*
* @breadcrumb Network / ServerlessRequest
* @public
*/
declare class ServerlessRequest extends IncomingMessage {
constructor({ method, url, headers, body, remoteAddress, }: ServerlessRequestProps);
ip?: string;
body?: Buffer | Uint8Array;
}
export { ServerlessRequest as S, type ServerlessRequestProps as a };