H. *_*lyn 36 networking webserver android localhost angular-cli
我知道从这个问题和在桌面上的localhost上运行的 超级用户站点上的答案在Android设备上无法访问(PS:这个问题在链接中的问题上继续)该命令ng serve打开一个错误配置的Web服务器.
问题是如何在不部署我的网站的情况下在Android设备上运行我的网站.我将尝试http://192.168.0.168:4200使用Angular-CLI 在此URL上运行该站点.
Ahm*_*lam 70
试试服务--host选项,如本期所述:https://github.com/angular/angular-cli/issues/1793 intellix评论.
ng serve --host 0.0.0.0<local ip adress>:4200从同一网络上的任何设备导航到.否则请尝试https://ngrok.com/从本地网络打开隧道到您的计算机localhost.基本上,您的计算机会将4200端口转发到网络上任何设备都可以访问的外部IP和端口.
Sha*_*got 15
首先验证您的机器IP地址.
ipconfig提示(复制IPv4).ifconfig |grep inet终端(复制inet).
就我而言,这是192.168.0.10.
接下来,输入ng serve --host 192.168.0.10.
好的,您的应用程序在同一网络上的所有设备上播出.
现在只会http://192.168.0.10:4200/工作,localhost而不是更多.
小智 8
当我尝试使用
ng serve --host local ip address
我正面临
无效的标头请求
此问题已解决使用 --disable-host-check
ng serve --host local ip address --disable-host-check
| 归档时间: |
|
| 查看次数: |
29049 次 |
| 最近记录: |