webpack踩坑:只能通过localhost和127.0.0.1访问本机应用,无法通过ip地址访问

index.js文件中的host默认值为localhost,也就是只能通过这个hostname访问,这样排除了被他人远程访问的可能性,这也就是为什么通过192.168.x.x无法访问的原因。

通过将其改为0.0.0.0,允许任意人访问。

猜你喜欢

转载自blog.csdn.net/Cheng_Kohui/article/details/93328954