chenhaozhe
2026-11-09 e0da2f80699c966fb3cf95bae9fbba88e5406ac9
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()