【发布时间】:2017-03-02 14:41:14
【问题描述】:
我的 Angular 项目位于 app 文件夹中,因此我必须将其发送至 http://localhost:45485/app,但我想从该 URL 中删除 app。我正在尝试这样做,但它不起作用。我不知道该怎么办,请帮帮我。
web.config 文件:
<rewrite>
<rules>
<clear/>
<rule name="app" stopProcessing="true">
<match url="^(.+)$" />
<conditions>
<add input="{APPL_PHYSICAL_PATH}app\{R:1}" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="/app/{R:1}" />
</rule>
<rule name="index.html as document root" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="/app/index.html" />
</rule>
</rules>
</rewrite>
结果我遇到了这个问题:
【问题讨论】:
-
虽然我对如何(正确地)做到这一点很感兴趣,但对“为什么”感到好奇?对于“web api”应用程序?如果这是一个前端角项目(仅),那么它似乎是“方孔中的圆钉”....
-
@EdSF,我只是研究了一下,有些时候看不懂,为什么不呢?而且在我看来,这是真的,所以我想试试。
标签: asp.net .net asp.net-web-api