I have the following setup:
- A .net core web api 2.1.x app
- An angular app in a separate project
I would like to host them both in one iis Site so that they are like that:
localhost\Site\ < --- angular app
localhost\Site\Api\ < --- web api app
I tried to run the .net core web api project from a virtual folder but with no luck. Getting a 404 exections
The web api works if I host the Web api project directly (binding the Application path to the \Api folder). But then that app needs to serve also statics files witch It does not whant to do for some reason even doh I enabled:
ConfigureServices
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "App";
});
...
Configuration
app.UseStaticFiles(new StaticFileOptions()
{
OnPrepareResponse = (context) =>
{
// Disable caching for all static files.
context.Context.Response.Headers["Cache-Control"] = Configuration["StaticFiles:Headers:Cache-Control"];
context.Context.Response.Headers["Pragma"] = Configuration["StaticFiles:Headers:Pragma"];
context.Context.Response.Headers["Expires"] = Configuration["StaticFiles:Headers:Expires"];
}
});
Anyone know where I could find some instructions regarding this?
