Skip to content

Instantly share code, notes, and snippets.

@reganstarr
Created June 23, 2016 13:59
Show Gist options
  • Save reganstarr/4949bb398ac543ee29daf604de568cf3 to your computer and use it in GitHub Desktop.
Save reganstarr/4949bb398ac543ee29daf604de568cf3 to your computer and use it in GitHub Desktop.
function apiCallFunction(){
var apiUrl = '';
fetch(apiUrl, {
method: 'GET'
})
.then(function(res) {
return res.json();
})
.then(function(body) {
// do something
callback(null, {}); // By using {} here, we aren't defining the 'output' of the Code step yet so we can make multiple api calls
})
.catch(callback);
}
apiCallFunction();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment