【发布时间】:2018-04-26 07:56:07
【问题描述】:
我使用 Angular(当前版本 5)构建全栈应用程序通常后端是 Windows Server 并且它使用 IIS ,因此我知道使用重写模块代码部署 web.config 文件。
问题是该站点是一个 SPA ,它需要始终指向 index.html,无论 URL 说什么...
如我所说,我习惯 windows ,但后端是 Java 和 IBM Websphere
有人知道我需要做什么才能拥有一个正常工作的 Angular 应用程序吗?
例如,WINDOWS 的配置是如下所示的 web.config,但这是带有 Java 应用程序的 Websphere,我假设后端是 Linux/unix
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/MyApp/" />
<!--<action type="Rewrite" url="/" />-->
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
【问题讨论】:
标签: java linux angular unix websphere