Created
January 22, 2018 02:30
-
-
Save mweagle/81abd4332029d63b6bb63575af60476f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Register the function with the API Gateway | |
apiStage := sparta.NewStage("v1") | |
apiGateway := sparta.NewAPIGateway("SpartaHTML", apiStage) | |
// Enable CORS s.t. the S3 site can access the resources | |
apiGateway.CORSOptions = &sparta.CORSOptions{ | |
Headers: map[string]interface{}{ | |
"Access-Control-Allow-Headers": "Content-Type,X-Amz-Date,Authorization,X-Api-Key", | |
"Access-Control-Allow-Methods": "*", | |
"Access-Control-Allow-Origin": gocf.GetAtt(s3Site.CloudFormationS3ResourceName(), "WebsiteURL"), | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment