api-gateway-lambda-in-various-runtimes icon indicating copy to clipboard operation
api-gateway-lambda-in-various-runtimes copied to clipboard

Examples of serverless Lambda functions integrated with API Gateway and CORS enabled

Examples of various Lambda function integrations with API Gateway and CORS enabled

Why? When working with Lambda functions, there are various different things to take into consideration.

  • Is this function being invoked from an HTTP trigger?
  • Is this function using API Gateway?
  • Are you calling this function from a client-side application?
  • Are you running into CORS issues when fetching data from your Lambda function?

If you answered yes to these questions, then these copy-paste examples should help you to get up and running with many of the most popular runtimes.

Here are the supported runtimes that I will be creating examples for:

Go

main.go

Python

index.py

.Net

handler.cs

NodeJS / JavaScript

index.js

Java

handler.java

Check out this serverless example for a full Java implementation

More examples

For more examples of Lambda integrations in different languages, check out the Serverless Examples