SpaRoutingModule.cs 820 B

1234567891011121314151617181920
  1. namespace WebTemplate.ServerAspects.Spa;
  2. /// <summary>
  3. /// IMPORTANT: The <see cref="SpaDefaultPageMiddleware"/> _by design_ MUST map ALL previously unmapped routes
  4. /// to the default page which makes this module very susceptible to ordering issues. Any middleware that is registered
  5. /// AFTER the SPA default page middleware is not actually going to get a chance to add anything to the routing process
  6. /// if at the point of the SPA default page middleware the "GetEndpoint" method returns null.
  7. /// </summary>
  8. public class SpaRoutingModule : IAppConfigurationModule
  9. {
  10. public void ConfigureServices(IServiceCollection services, IConfigurationRoot config)
  11. {
  12. }
  13. public void ConfigureApplication(WebApplication app)
  14. {
  15. app.UseMiddleware<SpaDefaultPageMiddleware>();
  16. app.UseStaticFiles();
  17. }
  18. }