离线服务在localhost而不是服务器IP上启动

编程入门 行业动态 更新时间:2024-10-25 08:24:04
本文介绍了离线服务在localhost而不是服务器IP上启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

运行离线服务时,我看到:

Gulp启动任务:['sass','watch'] 运行dev服务器:http:// localhost:8100 运行live重载服务器:http:// localhost:35729 观看:['www / ** / *','!www / lib / ** / *'] Ionic服务器命令,输入: restart或r从根重新启动客户端应用程序 goto或g和一个url,让应用程序导航到给定url consolelogs或c启用/禁用控制台日志输出 serverlogs或s以启用/禁用服务器日志输出 quit或q关闭服务器并退出

这意味着我无法从浏览器访问该应用程序,因为它只侦听localhost。如何将localhost更改为实际的服务器IP?

感谢

解决方案

pre> `ionic address`

提供地址列表。选择一个

例如:

请通过从下面的列表中输入其号码来选择要使用的地址: 1)10.0.0.9(wlan0) 2)172.16.58.1(vmnet1) 3)172.16 .16.1(vmnet8) 4)localhost 提示前的std 地址选择:

When running ionic serve I see this:

Gulp startup tasks: [ 'sass', 'watch' ] Running dev server: localhost:8100 Running live reload server: localhost:35729 Watching : [ 'www/**/*', '!www/lib/**/*' ] Ionic server commands, enter: restart or r to restart the client app from the root goto or g and a url to have the app navigate to the given url consolelogs or c to enable/disable console log output serverlogs or s to enable/disable server log output quit or q to shutdown the server and exit

Which means I cannot access the app from a browser as its only listening for localhost. How can I change localhost to the actual server IP?

Thanks

解决方案

`ionic address`

gives a list of address. select one

eg :

Multiple addresses available. Please select which address to use by entering its number from the list below: 1) 10.0.0.9 (wlan0) 2) 172.16.58.1 (vmnet1) 3) 172.16.16.1 (vmnet8) 4) localhost Std in before prompt Address Selection:

更多推荐

离线服务在localhost而不是服务器IP上启动

本文发布于:2023-10-15 00:53:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492755.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:离线   而不是   服务器   IP   localhost

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!