Amazon API Gateway REST API with AWS Lambda proxy integration and CORS enabled

API Gateway REST API → AWS Lambda

API Gateway REST API with Lambda proxy integration

A REST API is created that has a GET method with a Lambda integration where API Gateway returns the CORS headers.
The API also has an OPTIONS method with a Lambda proxy integration where the backend Lambda function returns the CORS headers.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-cors-proxy

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Noor Bari

Noor Bari

Cloud Support Engineer @ AWS.

Follow on LinkedIn