问题描述
当我在tomcat中部署我的angular应用程序时,它在URL中创建了两个文件名,导致404错误。我使用了ng build --base-href = usersfront命令。请帮助我解决这个问题。
解决方法
按照下面的步骤
-
ng build --base-href=/userfront/
- 成功构建项目后
- 在tomcat
userfront
中创建web-apps
文件夹,并将所有文件(html,css和js)从dist
文件夹复制到userfront
文件夹。 - 然后尝试使用此网址http://localhost:8080/userfront/index.html