I have created a ASP.NET Core Web API with Angular project in VS 2019. I accepted all the default settings and it's successfully launched. My goal is to eventually create a combination of MVC, Angular with Areas and API in one project.
From the Configure method of Startup.cs, I can see the routing configuration is:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
});
and the SPA configuration is:
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.Options.StartupTimeout = new TimeSpan(0, 0, 80);
spa.UseAngularCliServer(npmScript: "start");
}
});
I would like to learn how the index.html (along with Angular content/components) under ClientApp/src is chosen to be sent to the browser as the default page. How does this work?