I am trying to replicate data from CouchDB to PouchDB for offline storage using the code to pull data from CouchDB:
db.replicate.from('http://test.iriscouch.com/todo','idb://todo', function (err, changes) {
if (err) {
console.log(err);
}
else {
console.log(changes);
}});
$scope.loadTodos(response.rows);
I get these errors:
Is there something I'm not doing correct?
要使PouchDB与CouchDB通信,它需要在同一个域上运行,或者需要在Pouch和Couch之间安装CORS-Proxy,这是由于浏览器强制实施的原始策略,CouchDB的下一个版本将有希望本地支持这个,但同时对于一个生产网站,我会发现最简单的方法是使用nginx让小袋和沙发在同一个域上运行
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.