public FeatureRoutingMiddleware( ILogger <FeatureRoutingMiddleware> logger, EndpointDataSource endpointDataSource, FeatureRoutingConfiguration routingConfiguration, RequestDelegate next) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _endpointDataSource = endpointDataSource ?? throw new ArgumentNullException(nameof(endpointDataSource)); _routingConfiguration = routingConfiguration ?? throw new ArgumentNullException(nameof(routingConfiguration)); _next = next ?? throw new ArgumentNullException(nameof(next)); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); //Feature routing Configuration Initialization var featureRoutingConfiguration = new FeatureRoutingConfiguration(); Configuration.Bind("FeatureRouting", featureRoutingConfiguration.Features); services.AddSingleton(typeof(FeatureRoutingConfiguration), featureRoutingConfiguration); // In production, the React files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/build"; }); }