【问题标题】:how to run angular5 app from another machine?如何从另一台机器运行 angular5 应用程序?
【发布时间】:2018-01-16 17:00:10
【问题描述】:

如何从另一台机器运行 angular5 应用程序?

我尝试过的命令

ng serve --host 192.168.56.1 --disable-host-check

ng serve --host 192.168.56.1

ng serve --host 0.0.0.0

ng serve --port 8080 --host 0.0.0.0 --disableHostCheck true

我已经看过this。虽然没有帮助。 我的角度/cli 版本:1.5.5

【问题讨论】:

标签: angular angular-cli


【解决方案1】:

如果您的其他设备在同一个网络中,您可以使用 ng serve 访问:

ng serve --port 8080 --host 0.0.0.0 --disableHostCheck true

值“0.0.0.0”应该允许您从本地网络上的任何设备访问网络服务器。

但我希望 8080 端口在你的防火墙上是开放的

【讨论】:

  • 状态栏应该写什么?
  • 状态栏?试试: ng serve --host 0.0.0.0 --disableHostCheck true 在命令行中
  • 我确实试过这个命令。它说“在localhost:8080 ** 上打开你的浏览器 **
猜你喜欢
  • 1970-01-01
  • 2019-10-26
  • 2018-04-21
  • 1970-01-01
  • 2017-04-20
  • 1970-01-01
  • 2017-09-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多