diff --git a/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/AbpHostingHostBuilderExtensions.cs b/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/AbpHostingHostBuilderExtensions.cs new file mode 100644 index 000000000..9baebb6fb --- /dev/null +++ b/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/AbpHostingHostBuilderExtensions.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; + +namespace LINGYUN.MicroService.Internal.Gateway; + +public static class AbpHostingHostBuilderExtensions +{ + public const string AppYarpJsonPath = "yarp.json"; + public static IHostBuilder AddYarpJson( + this IHostBuilder hostBuilder, + bool optional = true, + bool reloadOnChange = true, + string path = AppYarpJsonPath) + { + return hostBuilder.ConfigureAppConfiguration((_, builder) => + { + builder.AddJsonFile( + path: AppYarpJsonPath, + optional: optional, + reloadOnChange: reloadOnChange + ); + }); + } +} diff --git a/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/Program.cs b/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/Program.cs index 85e12d42c..32aaa1369 100644 --- a/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/Program.cs +++ b/gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.Gateway/Program.cs @@ -19,6 +19,7 @@ public static async Task Main(string[] args) var builder = WebApplication.CreateBuilder(args); builder.Host.AddAppSettingsSecretsJson() .UseAutofac() + .AddYarpJson() .ConfigureAppConfiguration((context, config) => { var configuration = config.Build(); diff --git a/starter/readme.md b/starter/readme.md index 1ef2f6f55..6a7ea7429 100644 --- a/starter/readme.md +++ b/starter/readme.md @@ -1,8 +1,10 @@ -快速启动后端项目: -1.使用 00.auto-config-docker.cmd 自动配置docker环境 -2.使用 01.migrate-db.cmd 迁移数据库 -3.使用 80.start-host.cmd 启动后端项目 -注:请按自己电脑运行速度调整 80.start-host.cmd 文件中的 stime 参数。 -快速启动前端项目: -1.使用 91.install-node-module.cmd 安装npm依赖 -2.使用 99.start-all.cmd 启动项目 \ No newline at end of file +**快速启动后端项目:** +1. 使用 `00.auto-config-docker.cmd` 自动配置docker环境 +2. 使用 `01.migrate-db.cmd` 迁移数据库 +3. 使用 `80.start-host.cmd` 启动后端项目 + +注:请按自己电脑运行速度调整 `80.start-host.cmd` 文件中的 `stime` 参数。 + +**快速启动前端项目:** +1. 使用 `91.install-node-module.cmd` 安装npm依赖 +2. 使用 `99.start-all.cmd` 启动项目