I know this seems simplistic but I don’t see in the README for pretender where we are supposed to put our mock server code. Basically, where do we put the code below in an Ember-cli app?
var PHOTOS = {
"10": {
id: 10,
src: 'http://media.giphy.com/media/UdqUo8xvEcvgA/giphy.gif'
},
"42": {
id: 42,
src: 'http://media0.giphy.com/media/Ko2pyD26RdYRi/giphy.gif'
}
};
var server = new Pretender(function(){
this.get('/photos', function(request){
var all = JSON.stringify(Object.keys(PHOTOS).map(function(k){return PHOTOS[k]}))
return [200, {"Content-Type": "application/json"}, all]
});
this.get('/photos/:id', function(request){
return [200, {"Content-Type": "application/json"}, JSON.stringify(PHOTOS[request.params.id])]
});
});
I want to run the mock server for development and demo purposes not just for testing. I know I am missing something simple but I do not see any explanation on how to do this.