我正在尝试将ember与sails连接,但在rest rest
中似乎出错了
import DS from 'ember-data';
import Ember from 'ember';
import appConf from '../models/app-conf'
export default DS.RESTAdapter.extend({
// authorizer: 'authorizer:oauth2',
namespace: 'api/v1',
host: localhost:1337,
// session: Ember.inject.service('session'),
// headers: Ember.computed('session.isAuthenticated', function () {
// return {
// 'authenticated': this.get('session.isAuthenticated')
// };
// }),
shouldReloadAll: function () { return true; },
shouldBackgroundReloadRecord: function () { return false; },
modelType: null,
pathForType: function (type) {
if (Ember.isNone(this.get("modelType")))
throw this + ".modelType is not set!!!";
return this.get("modelType");
}
});
这段代码有什么不对, 提前谢谢你..
答案 0 :(得分:3)
host: localhost:1337,

将其更改为
host: 'http://localhost:1337',

Ember适配器仅支持http,htts ..