Program.cs
@@ -1,4 +1,12 @@ var builder = WebApplication.CreateBuilder(args); using Microsoft.Extensions.Hosting.WindowsServices; var builder = WebApplication.CreateBuilder(new WebApplicationOptions { Args = args, ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : null }); builder.Services.AddWindowsService(options => options.ServiceName = "APIGetway"); // YARP 反向代理 builder.Services.AddReverseProxy()