I need help synchronizing PouchDB with Couchbase Sync Gateway.
I keep getting the following error indicating a CORS problem, but I configured Couchbase Sync Gateway (CSG) for CORS according to their documentation.
XMLHttpRequest cannot load http://localhost:4985/test-database/.
No 'Access-Control-Allow-Origin'header is present on the requested
resource. Origin 'http://localhost:3000' is therefore not
allowed access.
I tried the following configuration file in CSG docs:
http://developer.couchbase.com/documentation/mobile/1.2/develop/guides/sync-gateway/configuring-sync-gateway/config-properties/index.html
{
"log": ["HTTP+"],
"CORS": {
"origin":["http://localhost:3000"],
"loginOrigin":["http://localhost:3000"],
"headers":["Content-Type"],
"maxAge": 1728000
},
"databases": {
"test-database": {
"server": "walrus:",
"users": { "GUEST": {"disabled": false, "admin_channels": ["*"] } }
}
}
}
I also tried other configuration files from the Couchbase blog, but none of them work! Any help with this would be greatly appreciated!
source
share