Skip to main content

Function URLs

The AWS Lambda Function URLs has the same API interface of API Gateway V2, so you can use the ApiGatewayV2Adapter to support it.

index.ts
import { ServerlessAdapter } from '@h4ad/serverless-adapter';
import { ApiGatewayV2Adapter } from '@h4ad/serverless-adapter/adapters/aws';
import { DefaultHandler } from '@h4ad/serverless-adapter/handlers/default';
import app from './app';

export const handler = ServerlessAdapter.new(app)
.setHandler(new DefaultHandler())
// .setFramework(new ExpressFramework())
// .setResolver(new PromiseResolver())
.addAdapter(new ApiGatewayV2Adapter())
// customizing:
// .addAdapter(new ApiGatewayV2Adapter({ stripBasePath: '/prod' }))
.build();

AWS Lambda Response Streaming

To support response streaming, read the docs on AwsStreamHandler.