Enabling CORS
To replicate directly with CouchDB, you need to make sure CORS is enabled. Only set the username and password if you have set them previously. By default, CouchDB will be installed in "Admin Party," where username and password are not needed. You will need to replace myname. example. com with your own host (127.0.0.1:5984 if installed locally):
You can enable CORS in CouchDB using curl or the Futon web interface, but we've saved you some time by making a Node script called add-cors-to-couchdb. Just run:
$ npm install -g add-cors-to-couchdb
$ add-cors-to-couchdb
Or if your database is not at 127.0.0.1:5984:
$ add-cors-to-couchdb http://me. example. com -u myusername -p mypassword
You can check that CORS is now enabled by visiting http://localhost:5984/_utils/config.html in your browser. You should see something like this: