【问题标题】:How to deploy angular-cli app on Websphere?如何在 Websphere 上部署 angular-cli 应用程序?
【发布时间】: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。跨度>

标签: angular websphere


【解决方案1】:

使用以下错误状态代码更新了 WebSphere 中的 web.xml 文件。提及已部署的 Angular 应用程序的路径。

<error-page>
    <error-code>404</error-code>
    <location>/path/sampleapp/index.html</location>
</error-page>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-25
    • 2017-11-16
    • 1970-01-01
    • 1970-01-01
    • 2018-08-18
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    相关资源
    最近更新 更多