samedi 21 février 2015

Can't change adapter host with Ember

I've read Ember docs about this and I know that I have to use custom RESTAdapter and set it to App.Store. I did it and it changes namespace but, it doesn't work with host (it still makes request to current domain).



App.ApplicationAdapter = DS.RESTAdapter.extend({
host: 'https://api.example.com',
namespace: 'kraken'
});

App.Store = DS.Store.extend({
adapter: App.ApplicationAdapter
});


App.IndexRoute = Ember.Route.extend({
model: function() {
return this.store.find('game');
}
});


And request is being made to current domain instead to https://api.example.com



Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8080/kraken/games

Aucun commentaire:

Enregistrer un commentaire