Skip to content

Instantly share code, notes, and snippets.

@mweagle
Created April 25, 2016 18:37
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/6574a57e558fd69c91698fdb4a4be12c to your computer and use it in GitHub Desktop.
Save mweagle/6574a57e558fd69c91698fdb4a4be12c to your computer and use it in GitHub Desktop.
// Add the string literal adapter, which requires us to add exported
// functions to the end of index.js. These NodeJS exports will be
// linked to the AWS Lambda NodeJS function name, and are basically
// automatically generated pass through proxies to the golang HTTP handler.
nodeJSWriter, err := lambdaArchive.Create("index.js")
if err != nil {
return nil, errors.New("Failed to create ZIP entry: index.js")
}
nodeJSSource := _escFSMustString(false, "/resources/index.js")
nodeJSSource += "\n// DO NOT EDIT - CONTENT UNTIL EOF IS AUTOMATICALLY GENERATED\n"
for _, eachLambda := range ctx.lambdaAWSInfos {
nodeJSSource += createNewNodeJSProxyEntry(eachLambda, ctx.logger)
}
// SPARTA CUSTOM RESOURCES
for _, eachCustomResourceName := range golangCustomResourceTypes {
nodeJSSource += createNewSpartaCustomResourceEntry(eachCustomResourceName, ctx.logger)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment