Skip to content

Instantly share code, notes, and snippets.

@mweagle
Last active January 22, 2018 02:31
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 mweagle/5ac2627ce6c81b3342e721dd97ba86ff to your computer and use it in GitHub Desktop.
Save mweagle/5ac2627ce6c81b3342e721dd97ba86ff to your computer and use it in GitHub Desktop.
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