gpt4 book ai didi

node.js - 无法连接到服务器 - Migration Parse Server iOS

转载 作者:搜寻专家 更新时间:2023-11-01 07:23:57 25 4
gpt4 key购买 nike

我正在学习本教程:https://www.raywenderlich.com/128313/parse-server-tutorial我已经成功完成了将数据迁移到 mLab 以及设置解析服务器的步骤。

我运行这个 curl 命令

$ curl -X GET \
-H "X-Parse-Application-Id: <myAppId>" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/classes/_User

它返回我所有用户的 JSON。在这一步之后,教程说要运行应用程序并发布一些数据。然而,这就是我卡住的地方,我在尝试登录时收到以下错误代码,[错误]:无法连接到服务器。 (代码:100,版本:1.12.0)。我按照教程中的说明配置了我的应用程序 key 和服务器 url。

    let configuration = ParseClientConfiguration {
$0.applicationId = "YOUR_APP_ID"
$0.clientKey = ""
$0.server = "http://localhost:1337/parse"
}
Parse.initializeWithConfiguration(configuration)

最佳答案

在启动解析服务器之前设置 env var VERBOSE=1,看看你的 curl 请求和 ios sdk 有什么区别。

一旦收到请求,parse-server 将显示请求的日志。如果您在 ios-app 发送请求后没有看到任何日志。检查您的 ios-app serverUrl 是否正确。

您的 ios-app 上的 serverUrl 不应该是 localhost。 Localhost 表示您的设备,它不托管解析服务器。您应该将其更改为托管解析服务器的 IP(127.0.0.1 除外)或域名。如果你的手机和服务器连接到同一个wifi,你可以使用192.168.x.x(ifconfig)来连接。

关于node.js - 无法连接到服务器 - Migration Parse Server iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37183575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com