Couchbase Mobile(同步网关)TODOlite应用程序示例不';t复制;抱怨facebook没有';不存在
我的目标是:在Couchbase Mobile(同步网关)TODOlite应用程序示例不';t复制;抱怨facebook没有';不存在,couchbase,couchbase-lite,couchbase-sync-gateway,Couchbase,Couchbase Lite,Couchbase Sync Gateway,我的目标是:在localhost上与Couchbase服务器和同步网关同步,而不是使用默认的演示URL 我像这样运行同步网关:bin/sync\u gateway-urlhttp://localhost:8091 在这个例子中,我唯一改变的是: -#define kSyncGatewayUrl @"http://demo.mobile.couchbase.com/todolite" +#define kSyncGatewayUrl @"http://localhost:4984/sync_gat
localhost
上与Couchbase服务器和同步网关同步,而不是使用默认的演示URL
我像这样运行同步网关:bin/sync\u gateway-urlhttp://localhost:8091
在这个例子中,我唯一改变的是:
-#define kSyncGatewayUrl @"http://demo.mobile.couchbase.com/todolite"
+#define kSyncGatewayUrl @"http://localhost:4984/sync_gateway/"
当我跑的时候
Error: Error Domain=CBLHTTP Code=404 "404 not_found" UserInfo=0x7ff11941fb50 {NSURL=http://localhost:4984/sync_gateway/_facebook, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found}
如何修复此问题?我解决了它。原因是我在没有启用Facebook注册支持的情况下运行了
sync\u gateway
通常这是在config.json
文件中完成的。其实,
使用此配置文件启动sync\u gateway
非常重要。自述文件实际上说明了这一点,但以一种松散和随意的方式
cd ToDoLite-iOS
sync_gateway -url http://localhost:8091 sync-gateway-config.json
注意:我假设上面的sync\u gateway
已通过$PATH
访问。无论如何,这样做是个好主意
另外,我没有注意到dbname
。所以你需要换一个
#define kSyncGatewayUrl @"http://demo.mobile.couchbase.com/todolite"`
与
那么,让它工作的完整步骤顺序是什么
rm-rf Library/Application\Support/Couchbase
,然后重新开始。自制桶将此设置隐藏在其他难以重置的位置,因此建议手动安装todos
的bucket(数据库)。这是TODOLite使用的dbname
bin/sync\u网关-urlhttp://localhost:8091 sync gateway config.json
;保持同步网关运行AppDelegate.m
中,更改kSyncGatewayUrl
:
#定义kSyncGatewayUrl@”http://localhost:4984/todos“
。请注意,数据库的名称是必需的http://localhost:4985/_admin/db/sync_gateway/sync
。您可以在此处设置同步功能如果您想知道这些端口号来自何处,请查看
-
- 4984-SG API端口
- 4985-SG管理服务器
#define kSyncGatewayUrl @"http://localhost:4984/todos"