休息适配器不在ember中工作

时间:2016-01-23 09:44:59

标签: ember.js sails.js

我正在尝试将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");

    	}
    });

这段代码有什么不对, 提前谢谢你..

1 个答案:

答案 0 :(得分:3)

似乎



host: localhost:1337,




将其更改为



host: 'http://localhost:1337',




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