Skip to content

Instantly share code, notes, and snippets.

@mxro
Created April 17, 2021 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxro/0ea8449bf89ad82fce540e1f766e5ea4 to your computer and use it in GitHub Desktop.
Save mxro/0ea8449bf89ad82fce540e1f766e5ea4 to your computer and use it in GitHub Desktop.
Entry point for Go Lambda
package main
import (
"os"
"github.com/aws/aws-lambda-go/lambda"
)
func main() {
// when no 'PORT' environment variable defined, process lambda
if os.Getenv("PORT") == "" {
lambda.Start(Handler)
return
}
// otherwise start a local server
StartLocal()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment