gpt4 book ai didi

angularjs - localhost 不工作 - vs 代码中的 chrome 扩展

转载 作者:行者123 更新时间:2023-12-04 17:58:14 25 4
gpt4 key购买 nike

在 vs code 中,我在 HTML angularjs 项目中创建了一个 launch.json 文件。我无法在我的本地主机上启动该项目。它一直显示为 Failed to load resource: net::ERR_CONNECTION_REFUSED (http://localhost:8080/)

项目结构:-

Project => .vscode => launch.json
=> app
=> scripts
=> styles
=> index.html

launch.json:-

{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
},
{
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
]
}

有人可以帮我解决这个问题吗?提前致谢

最佳答案

我遇到了同样的问题。

将我的 launch.json 文件更改为以下内容解决了问题(Chrome 是我的默认浏览器):

{
// 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": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\app.js"
}
]
}

app.js 在我工作区的根文件夹中。

这是之前的 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": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

关于angularjs - localhost 不工作 - vs 代码中的 chrome 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38560928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com