Here is my routes in (app/routes/customers.js):
export default Ember.Route.extend({
model: function() {
return $.getJSON("http://127.0.0.1:3000/odata/customers");
}
});
here is my router.js:
export default Router.map(function() {
this.route('customers', {path: '/'});
});
http://127.0.0.1:3000/odata/customers
is my api, but ember-cli use http://localhost:4200/
, when I open http://localhost:4200/
,
in the console, the error message is:
XMLHttpRequest cannot load http://127.0.0.1:3000/odata/customers. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
I find a article: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
so I know what's wrong, but I don't kown how to fix it when use ember.js.
sorry for my poor English, hope thats clear...