Anu
Anu

Reputation: 21

rest adapter not working in ember

i am trying to connect ember with sails , but it seems error in rest adapter

 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");

    	}
    });

whats wrong with ths code, thank you in advance..

Upvotes: 2

Views: 104

Answers (1)

Anvar Pk
Anvar Pk

Reputation: 122

it seems

host: localhost:1337,

change it to

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

Ember adapter only support http,htts..

Upvotes: 3

Related Questions