using Microsoft.Extensions.DependencyInjection; using Company.Project.Shared; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Autofac; using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; using Ocelot.DependencyInjection; using Ocelot.Middleware; namespace Company.Project.PublicWebGateway; [DependsOn( typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMultiTenancyModule) )] public class PublicWebGatewayHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); Configure(options => { options.IsEnabled = ProjectConsts.IsMultiTenancyEnabled; }); context.Services.AddOcelot(configuration); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseRouting(); app.UseOcelot().Wait(); } }