我需要帮助将PouchDB与Couchbase Sync Gateway同步。
我一直收到指向CORS问题的以下错误,但是我已根据Couchbase Sync Gateway的文档配置了CORS。
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.
根据CSG文档,我尝试使用以下配置文件:
{
"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": ["*"] } }
}
}
}
我也尝试了Couchbase博客中的其他配置文件,但它们都不起作用!非常感谢您提供的任何帮助!