using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Nop.Core.Configuration; using Nop.Core.Infrastructure; namespace Nop.Web.Framework.Infrastructure; /// /// Represents object for the configuring routing on application startup /// public partial class NopRoutingStartup : INopStartup { /// /// Add and configure any of the middleware /// /// Collection of service descriptors /// Configuration of the application public void ConfigureServices(IServiceCollection services, IConfiguration configuration) { } /// /// Configure the using of added middleware /// /// Builder for configuring an application's request pipeline public void Configure(IApplicationBuilder application) { //add the RoutingMiddleware application.UseRouting(); var commonConfig = Singleton.Instance.Get(); if (commonConfig.PermitLimit > 0) application.UseRateLimiter(); } /// /// Gets order of this startup configuration implementation /// public int Order => 400; // Routing should be loaded before authentication }