Last active
June 1, 2016 15:58
-
-
Save nolochemical/59392648ef61668232baa191cbcf99f4 to your computer and use it in GitHub Desktop.
Sending Fake Data To API callers
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
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