Created
April 17, 2021 03:28
-
-
Save mxro/0ea8449bf89ad82fce540e1f766e5ea4 to your computer and use it in GitHub Desktop.
Entry point for Go Lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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