Skip to navigation
Cross-Origin Request Blocked
25.06.15
when trying to sync between pouchdb and couchdb my firebug echo this: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[couchDBIP]:[couchDBPort]/[dbname]/?_nonce=[request hash]. This can be fixed by moving the resource to the same domain or enabling CORS set in the /etc/couchdb/local.ini file the following settings: httpd] bind_address = 0.0.0.0 enable_cors = true [cors] origins = * methods = GET,POST,PUT,HEAD,DELETE headers = accept,authorization, content-type,origin, referer,TODO credentials = true my JavaScript sync test looks like: var remoteDB = new PouchDB('http://remote.com:5984/mycouchdb'); var localDB = new PouchDB('mypuchdb'); localDB.replicate.from(remoteDB,{live: true,retry: true}).on('complete', function () { console.log('yay, were done!;'); }).on('error', function (err) { console.log('boo, something went wrong!'); })
http://pouchdb.com/errors.html
Reply
Anonymous
Information Epoch 1732575076
Effectiveness beats efficiency.
Home
Notebook
Contact us