【发布时间】:2019-04-17 07:42:50
【问题描述】:
我有简单的 Angular 7 应用程序。我使用 ng build -- href 进行了生产构建。构建完成后,我们将 dist 文件夹放置到服务器位置。应用程序工作正常,但是当我刷新应用程序时,服务器(WebSphere)无法获取应用程序的路由路径。只有当我们重定向到 index.html 时它才能正常工作
我使用了下面给出的路由策略。
const appRoutes: Routes = [
{ path: '', component: DashboardComponent },
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes, { useHash: true })],
exports: [RouterModule]
})
【问题讨论】:
-
请参阅此链接以获取角度服务器部署配置arjunphp.com/deploy-angular-app-production-nginx
-
感谢@SayanSamanta 提供链接,但我们面临的问题是。我可以通过在 web 配置文件中指定 (
) 在 IIS 中运行相同的应用程序,但同样不适用于 web sphere。跨度>