本地启动服务之后一般会给个http://localhost:4000

但是直接用chrome可能打不开,一个是localhost和127.0.0.1的映射

一个是https的问题

hosts

管理员进cmd,这行命令会把hosts文件换为原版

1
for /f %P in ('dir  %windir%\WinSxS\hosts /b /s') do copy %P %windir%\System32\drivers\etc & echo %P  & Notepad %P

http

chrome会自动把http改成https

1
2
chrome://net-internals/#hsts    把localhost加进去
chrome://settings/security

image

image