【发布时间】:2014-08-14 14:38:06
【问题描述】:
即使在 ember-cli 中的适配器中设置主机后,请求也会发送到页面域:
适配器/students.js
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host:"localhost:8080/Hello"
});
路线/students.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function(){
return this.store.find('students');
}
});
加载学生模板时,它会将请求发送到“localhost:4200/students”并给出错误GET localhost:4200/students 404 (Not Found)。该应用在 localhost:4200 上提供服务,但请求应发送到“localhost:8080/Hello/students”。
【问题讨论】: