Skip to content

Instantly share code, notes, and snippets.

@nolochemical
Last active June 1, 2016 15:58
Show Gist options
  • Save nolochemical/59392648ef61668232baa191cbcf99f4 to your computer and use it in GitHub Desktop.
Save nolochemical/59392648ef61668232baa191cbcf99f4 to your computer and use it in GitHub Desktop.
Sending Fake Data To API callers
var dataSender = (function(){
return {
createUser: function(id){
console.log('user: '+id+' created');
},
getUser: function(id){
console.log('{"basketId" : "f1c4678968d6","name" : "Bob Barker","username" : "bobbarker","address" : "123 cherry tree lane","tel" : 6471235555,"email" : "bob@barker.com","active": true,"orders":[] }');
},
updateUser: function(id){
console.log('user:'+id+' updated');
},
deleteUser: function(id){
console.log('user: '+id+' deleted');
},
createOrder: function(){
console.log('user: '+id+' created.');
},
getOrder: function(id){
var n = moment().unix();
console.log('['+n+'] helllo');
},
updateOrder: function(id){},
deleteOrder: function(id){}
};
})();
// Throw this guy in server endpoint for [GET] http://api.yourteam.com/orders/{id} <- 'f1c4678968d6'
dataSender.getUser(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment