2017-08-24 80 views
0

我已经使用angular-cli生成了我的项目。我创建了一个新的Java Maven项目,启动了“ng build”命令,并将dist /文件夹内容复制到我的java项目webapp /文件夹中。 当我尝试访问“http://localhost:8080/hsmt-front/”时,我收到了每个js脚本的404错误。 我该怎么做? 也是我的路线是:角色2在战争中:404错误

const appRoutes: Routes = [ 
{ 
    path: 'dashboard', component: DashboardPageComponent 
}, 
{ 
    path: 'account', component: DashboardPageComponent 
}, 
{ path: '**', redirectTo: 'dashboard', pathMatch: 'full' } 
]; 

我应该在我的路线 “hsmt前方”,像hsmt-前/仪表板,hsmt-前/帐户? Thx

回答

0

默认情况下,基本URL被设置为(/)或root。 将index.html中的基编辑为:

<base href="./">