使用本地服务器和自定义IP的流星测试应用 [英] Meteor testing app using local server and custom ip
问题描述
我也在开发流星应用程序客户端/服务器和应用程序. 当我使用以下命令编译应用程序时:
I'm developing an meteor application client/server and app, too. when i compile my application using this command:
meteor run ios-device --mobile-server 192.168.2.126
设备上的应用无法连接到服务器(我的服务器在本地网络上),并在javascrip控制台中返回此错误:
App on device cannot connect to server (my server is on local network) and return this error in javascrip console:
Failed to load resource: Could not connect to the server.
如果我使用:
meteor run ios-device
它可以正常工作.
为什么? 我需要在不同网络中的其他服务器上安装应用程序.该服务器始终具有相同的IP:192.168.2.126 ..当我连接到我的本地网络之一时,我需要我的客户端/应用程序应用程序能够正常工作.
Why? I need to have application installed on different server in different network. The server has always the same ip: 192.168.2.126.. I need my client/app application works when is connected to one of my local network..
推荐答案
已解决,我必须针对每个服务器url使用以下格式:
Solved, i have to use this format per server url:
http://192.168.2.126:3000
这篇关于使用本地服务器和自定义IP的流星测试应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!