Docker部署Appwrite访问/v1端点遇404及连接拒绝问题求助
Docker部署Appwrite后API端点访问异常及App连接问题解决
问题现象
在Docker环境部署Appwrite后,尝试访问端点http://localhost:80/v1时浏览器返回404错误,同时App端出现连接拒绝报错;但直接访问http://localhost:80(不带/v1)可正常打开,需解决App与Appwrite的连接问题。
浏览器端错误信息
{"message":"The requested route was not found. Please refer to the API docs and try again.", "code":404, "type":"general_route_not_found", "version":"1.4.9"}
App端错误栈
| #0 ClientIO.call (package:appwrite/src/client_io.dart:381:7) I/flutter (11975): │ #1 <asynchronous suspension> I/flutter (11975): |┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (11975): │ ⛔ Connection refused
解决方案
方法一:修改API端点
将原端点http://localhost:80/v1替换为以下任一有效端点即可解决问题:
http://192.168.xxx.xxx:80/v1(替换为你的主机局域网IP)http://127.0.0.1:80/v1
方法二:使用ADB端口转发
执行以下ADB命令:
adb root adb reverse tcp:80 tcp:80
内容的提问来源于stack exchange,提问作者Askani
相关产品推荐
相关产品推荐

