Created
October 14, 2018 17:45
-
-
Save ShelbyZ/82655d17a2267cf7ca7403fd5402b9ba to your computer and use it in GitHub Desktop.
Twilio Function template for calling other functions
This file contains 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
exports.handler = function(context, event, callback) { | |
let path = Runtime.getFunctions()['function_name'].path; | |
let fn = require(path); | |
fn.handler(context, event, (error, response) => { | |
if (error) { | |
console.log(error); | |
// handle error case | |
} else { | |
console.log(response); | |
// handle response | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment