Some boilerplate code for setting up CouchDB to PouchDB bidirectional replication with a changes feed on the local PouchDB database. Learn more about PouchDB here and CouchDB here!
- Install and turn on CouchDB
- Run
curl -X PUT http://username:password@127.0.0.1:5984/text
whereusername
andpassword
are from a CouchDB admin account. If you have not set up an admin account, there's a good guide to doing so withcurl
here - Run
curl -X PUT http://username:password@127.0.0.1:5984/text/_design/text --data-binary @ddoc.json
- If you have not enabled CORS on CouchDB, follow this guide here
- Open
index.html
and open the dev console to check out the logs getting printed