vscode调试html页面status200无法访问此网站 localhost 拒绝了我们的连接请求

系统:MacOS
软件:VSCode
下载了并安装VSCode后,新建Html5页面,安装Chrom和Debugger for Chrom,按F5进行调试报错,查找后发现需要在launch.json文件中配置file属性,默认file属性未配置。
launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}",
            "file": "${workspaceFolder}/index.html"
        }
    ]
}
发布了14 篇原创文章 · 获赞 3 · 访问量 3498

猜你喜欢

转载自blog.csdn.net/yulianpeng/article/details/91041183