Skip to content

Instantly share code, notes, and snippets.

@mweagle mweagle/define_resource.go
Last active Jan 22, 2018

What would you like to do?
if nil != api {
apiGatewayResource, _ := api.NewResource("/hello", lambdaFn)
// We only return http.StatusOK
apiMethod, apiMethodErr := apiGatewayResource.NewMethod("GET",
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
You can’t perform that action at this time.