While working on my Ember front end calling a Spring/Rest/MongoDB backend running locally for development, I encountered a same origin policy error. I am curious about the common workarounds for this issue.
Below is the code snippet I'm using:
App = Ember.Application.create();
App.Router.map(function(){
});
App.IndexRoute = Ember.Route.extend({
model: function(){
return App.User.find();
}
});
App.User = Ember.Model.extend({
lastName: Ember.attr()
});
App.User.adapter = Ember.Adapter.create({
findAll: function(klass, records) {
$.getJSONP("http://localhost:8080/users").then(function(data) {
records.load(klass, data.users);
});
}
})