Skip to content

Instantly share code, notes, and snippets.

@ShelbyZ
Created October 14, 2018 17:45
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 ShelbyZ/82655d17a2267cf7ca7403fd5402b9ba to your computer and use it in GitHub Desktop.
Save ShelbyZ/82655d17a2267cf7ca7403fd5402b9ba to your computer and use it in GitHub Desktop.
Twilio Function template for calling other functions
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