diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs new file mode 100644 index 00000000..b53c608f --- /dev/null +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/GatewayHostBuilderExtensions.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Configuration; + +namespace Microsoft.Extensions.Hosting; + +public static class AbpHostingHostBuilderExtensions +{ + public const string AppOcelotJsonPath = "ocelot.json"; + + public static IHostBuilder AddOcelotJson( + this IHostBuilder hostBuilder, + bool optional = true, + bool reloadOnChange = true, + string path = AppOcelotJsonPath) + { + return hostBuilder.ConfigureAppConfiguration((_, builder) => + { + builder.AddJsonFile( + path: AppOcelotJsonPath, + optional: optional, + reloadOnChange: reloadOnChange + ); + }); + } +} \ No newline at end of file