I have an ASP.NET Core 2.1 and I need to setup workspace for multiple Angular applications with following routing:
http://someurl.com/main -> first app
http://someu
@sven.to's answer works, I am just pasting here the full snippet for clarity:
app.Map("/foo", l => l.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
}));
This adds the /foo
prefix and now https://localhost:44383/foo/main.js
will show you main.js while https://localhost:44383/main.js
will give you 404 Not Found
.