Last active
January 22, 2018 02:31
-
-
Save mweagle/5ac2627ce6c81b3342e721dd97ba86ff 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
if nil != api { | |
apiGatewayResource, _ := api.NewResource("/hello", lambdaFn) | |
// We only return http.StatusOK | |
apiMethod, apiMethodErr := apiGatewayResource.NewMethod("GET", | |
http.StatusOK, | |
http.StatusOK) | |
if nil != apiMethodErr { | |
panic("Failed to create /hello resource: " + apiMethodErr.Error()) | |
} | |
// The lambda resource only supports application/json Unmarshallable | |
// requests. | |
apiMethod.SupportedRequestContentTypes = []string{"application/json"} | |
} | |
return append(lambdaFunctions, lambdaFn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment