net::ERR_ABORTED 404 (Not Found) on webcomponent

问题描述 投票:0回答:1

形象. 我做了一个angular web组件,我想测试一下,所以我创建了一个index.html文件,并把它保存在一个文件夹里。当我尝试在vs代码上使用live server运行它时,它运行得很好,但是当我尝试使用npx http-server或在其他angular项目中运行它时,它却显示404。我检查了脚本的路径,它是正确的,可能是什么原因?

angular server http-status-code-404 web-component
1个回答
0
投票

我通过在angular.json文件中添加脚本来解决这个错误。

© www.soinside.com 2019 - 2024. All rights reserved.