Created
April 25, 2016 20:27
-
-
Save mweagle/42a840c12d1606c97ebb4afc8f983109 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
// Return a string representation of a JS function call that can be exposed | |
// to AWS Lambda | |
func createNewNodeJSProxyEntry(lambdaInfo *LambdaAWSInfo, logger *logrus.Logger) string { | |
logger.WithFields(logrus.Fields{ | |
"FunctionName": lambdaInfo.lambdaFnName, | |
}).Info("Registering Sparta function") | |
// We do know the CF resource name here - could write this into | |
// index.js and expose a GET localhost:9000/lambdaMetadata | |
// which wraps up DescribeStackResource for the running | |
// lambda function | |
primaryEntry := fmt.Sprintf("exports[\"%s\"] = createForwarder(\"/%s\");\n", | |
lambdaInfo.jsHandlerName(), | |
lambdaInfo.lambdaFnName) | |
return primaryEntry | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment