2016-01-23 57 views
2

不工作我试图烬带帆联系,但似乎错误在休息适配器休息适配器烬

import DS from 'ember-data'; 
 

 
    import Ember from 'ember'; 
 
    import appConf from '../models/app-conf' 
 

 
    export default DS.RESTAdapter.extend({ 
 
    \t // authorizer: 'authorizer:oauth2', 
 
    \t namespace: 'api/v1', 
 
    \t host: localhost:1337, 
 
    \t // session: Ember.inject.service('session'), 
 
    \t // headers: Ember.computed('session.isAuthenticated', function() { 
 
    \t // \t return { 
 
    \t // \t \t 'authenticated': this.get('session.isAuthenticated') 
 
    \t // \t }; 
 
    \t // }), 
 
    \t shouldReloadAll: function() { return true; }, 
 
    \t shouldBackgroundReloadRecord: function() { return false; }, 
 
    \t modelType: null, 
 
     pathForType: function (type) { 
 
      if (Ember.isNone(this.get("modelType"))) 
 
       throw this + ".modelType is not set!!!"; 
 
    \t \t return this.get("modelType"); 
 

 
    \t } 
 
    });

什么不妥的部份代码, 预先感谢您。 。

+1

只是检查你的主机 –

+1

主机必须包含HTTP:// –

+1

检查主持人,它必须与http:// –

回答

3

似乎

host: localhost:1337,

改变它

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

灰烬适配器只支持HTTP,HTTS ..

+2

谢谢安瓦尔 – Anu

+2

不错的工作,它的工作 – Anu