如何在 Websphere 上部署 angular-cli 应用程序?
How to deploy angular-cli app on Websphere?
我有简单的 angular 7 app.I 使用 ng build -- href 进行生产构建。构建完成后,我们将 dist 文件夹放到服务器位置。应用程序工作正常,但是当我刷新应用程序时,服务器 (WebSphere) 无法获取 application.it 的路由路径,只有当我们重定向到 index.html
时才能正常工作
Angular 我使用了下面给出的路由策略。
const appRoutes: Routes = [
{ path: '', component: DashboardComponent },
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes, { useHash: true })],
exports: [RouterModule]
})
使用以下错误状态更新了 WebSphere 中的 web.xml 文件 code.Mention 部署的 angular 应用程序的路径。
<error-page>
<error-code>404</error-code>
<location>/path/sampleapp/index.html</location>
</error-page>
我有简单的 angular 7 app.I 使用 ng build -- href 进行生产构建。构建完成后,我们将 dist 文件夹放到服务器位置。应用程序工作正常,但是当我刷新应用程序时,服务器 (WebSphere) 无法获取 application.it 的路由路径,只有当我们重定向到 index.html
时才能正常工作Angular 我使用了下面给出的路由策略。
const appRoutes: Routes = [
{ path: '', component: DashboardComponent },
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes, { useHash: true })],
exports: [RouterModule]
})
使用以下错误状态更新了 WebSphere 中的 web.xml 文件 code.Mention 部署的 angular 应用程序的路径。
<error-page>
<error-code>404</error-code>
<location>/path/sampleapp/index.html</location>
</error-page>