Created
November 5, 2018 22:04
-
-
Save cplee/7d51f66fbba22c098d00f62b43a3198a to your computer and use it in GitHub Desktop.
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 ( | |
"fmt" | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
"os" | |
"strconv" | |
) | |
func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { | |
featureFlag, err := strconv.ParseBool(os.Getenv("FEATURE_FLAG")) | |
return events.APIGatewayProxyResponse{ | |
Body: fmt.Sprintf("Hello world!"), | |
Headers: map[string]string{ | |
"Feature-Flag": strconv.FormatBool(featureFlag), | |
}, | |
StatusCode: 200, | |
}, err | |
} | |
func main() { | |
lambda.Start(Handler) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment