I'm making an EmberJS application on port 4200 using Ember-Cli but it's using a database on port 8080. In my rest adapter, I overwrote find method (just to get something working) like this
find: function(store, type, id){
return this.ajax('http://localhost:8080/api', 'GET');
}
which is the same as the original find method except that I replace the call to buildURL with a string representation of the host I want to call. Although on the server I explicitly allow cross origin requests, I'm getting a net::ERR_SSL_PROTOCOL_ERROR
in the chrome browser. Furtherdown in the error message stack, there's reference to an EMBER.RSVP.Promise.hash.error... In my route, I use Ember.RSVP.hash like this
model: function(){
return Ember.RSVP.hash({
store: this.store.find('mymodelname')
})
}
What can I do to make this GET request work?
Aucun commentaire:
Enregistrer un commentaire