简体   繁体   中英

Angular 2 - Failed to load resource: the server responded with a status of 404 (Not Found)

在文件index.html中,我已导入文件config: <script src="http://localhost:4200/src/config.js"></script>文件config.js与索引位于同一文件夹中.html,但是当我在项目中吃午餐时,它在控制台上给了我这个错误:无法加载资源:服务器以404状态(未找到)进行了响应

您无需在src中提及localhost。

<script src="./config.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM