We deployed the .NET Core ServiceStack App as a virtual application in IIS.
The address is “https://mysite/api”.
The base app was developed using angular.
The problem is that the ‘/hello’ call result, which is a sample of the ServiceStack, is not what I want.
To run the .Net Core Virtual Application below the Angular site,
I added the web.config file to the angular site and applied the following URL Rewrite rules.
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Web API rule" stopProcessing="true">
<match url="/api/.*" />
<action type="None" />
</rule>
<rule name="Angular rule">
<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="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
If I call https://mysite/api/hello with [Route("/hello")], browser redirect to angular web site(root).
If I call https://mysite/api/api2/hello with [Route("/api2/hello")], browser redirect to angular web site(root).
If I call https://mysite/api/api/hello with [Route("/api/hello")], it’s working.
But in any case, there was no way to call /metadata.
Do I have to enter the Route attribute with ‘/api’, which is the path to the Virtual Application?
Can I set the path of the Virtual Application to Base url and let it run automatically?
I need a guide to add an Angular site to IIS and upload a ServiceStack to a Virtual Application.
Help!