Skip to content

Instantly share code, notes, and snippets.

@laran
Last active October 28, 2018 07:13
Show Gist options
  • Save laran/92e290becc6fde8e5249338f7f480ca3 to your computer and use it in GitHub Desktop.
Save laran/92e290becc6fde8e5249338f7f480ca3 to your computer and use it in GitHub Desktop.
exports.handler = async function(event, context) {
// Your code goes here ...
let success = function() {
// Do stuff ...
};
// Exit the handler by invoking the callback.
// The first argument is an error object (null indicates success).
// The second argument is the result. It must be JSON.stringify compatible.
if (success) {
callback(null, "Success :)");
} else {
callback("We tried :(");
}
}
exports.handler = function(event, context, callback) {
// Your code goes here ...
let success = function() {
// Do stuff ...
};
// Exit the handler by invoking the callback.
// The first argument is an error object (null indicates success).
// The second argument is the result. It must be JSON.stringify compatible.
if (success) {
callback(null, "Success :)");
} else {
callback("We tried :(");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment