ember.js - Connect to a RESTful service which ends all URLs with an "/" -
i have connect restful service ends every url "/".
the list of products at
http://company.com/api/products/
and product id 1 at
http://company.com/api/products/1/
this current app/adapters/products.js
import ds 'ember-data'; export default ds.restadapter.extend({ host: 'http://company.com', namespace: 'api' });
is there way configure ends "/" @ end?
overriding buildurl
method ds.restadapter
, appending slash should trick:
app.applicationadapter= ds.restadapter.extend({ buildurl: function() { var url = this._super.apply(this, arguments); return url + '/'; } });
Comments
Post a Comment