有沒有辦法指定can.Model的基礎URL?爲can.Model指定基本服務器URL的選項?
我看到服務器路徑被硬編碼是這樣的:
Wine = can.Model({
findAll : 'GET //localhost/Cellar-CanJS-Bootstrapped/api/wines',
findOne : 'GET //localhost/Cellar-CanJS-Bootstrapped/api/wines/{id}',
create : 'POST //localhost/Cellar-CanJS-Bootstrapped/api/wines',
update : 'PUT //localhost/Cellar-CanJS-Bootstrapped/api/wines/{id}',
destroy : 'DELETE //localhost/Cellar-CanJS-Bootstrapped/api/wines/{id}'
},{
})
我正在尋找一種方法指定基本URL模式,使我可以繼續我的配置是can.Model標準的方式。
感謝DAFF - 這就是我如何在目前這樣做了。 :-) –