SwitcHosts 本地ip映射域名

1. SwitcHosts 下载

官网   SwitchHosts - swh.app

Release SwitchHosts v4.1.2 · oldj/SwitchHosts · GitHub

 

 2.  端口号由8080 改为 80 端口

// 端口号由8080 改为 80 端口
devServer: {
	https: false,
	port: 80,
	open: true, // opens browser window automatically
}

3. 可对host 文件进行配置,更灵活

windows host 文件查找

  • C:\Windows\System32\drivers\etc\hosts
  • hosts是一个没有扩展名的系统文件

Mac host 文件查找

  • 打开访达后,在键盘上按Shift+Command+G组合键。
  •  在窗口中输入hosts文件的所在路径,/etc/hosts 输入后点击“前往”。

4. 域名设置却无效果

确保域名设置没问题,清除浏览器缓存即可更新成功

猜你喜欢

转载自blog.csdn.net/yf18040578780/article/details/127194210