I have this ASP.NET Core 3.1 Web API application which is used by 2 SPA Angular applications; one in "app" route and the other in "admin" route.
The routing piece of code is like below:
app.Map("/app", client => // =======> changed to "/" but no used
{
client.UseSpa(spa =>
{
spa.Options.SourcePath = "app";
spa.Options.DefaultPageStaticFileOptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "app")),
};
});
}).Map("/admin", admin =>
{
admin.UseSpa(spa =>
{
spa.Options.SourcePath = "admin";
spa.Options.DefaultPageStaticFileOptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "admin")),
};
});
});
I need to go to the first application (app) in the root. I tried to change the route "/app" to "/" but it did not work.