ApiGatewayV2 component lets you add an Amazon API Gateway HTTP API to your app.
Constructor
sst.config.ts
Parameters
domain
Set a custom domain for your HTTP API. Supports AWS Route 53, Cloudflare, and Vercel.For Cloudflare domains:
cors
Configure CORS (Cross-origin resource sharing) settings for your HTTP API.Disable CORS:
link
Link resources to all routes. These will be merged with resources linked to individual routes.
Properties
url
nodes
Methods
route
SDK
Access the API URL in your function code:src/lambda.ts
Examples
Add routes
sst.config.ts
Add a custom domain
sst.config.ts
Link resources to all routes
sst.config.ts
Configure CORS
sst.config.ts