upd:刚刚好像没加完

This commit is contained in:
2025-10-26 15:25:45 +08:00
parent e4629b1771
commit 75cd096b60

View File

@ -1,6 +1,7 @@
using KonSoft.InternalGateway; using KonSoft.InternalGateway;
using KonSoft.InternalGateway.Extensions; using KonSoft.InternalGateway.Extensions;
using KonSoft.Shared.Hosting.AspNetCore; using KonSoft.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Rewrite;
using Serilog; using Serilog;
var assemblyName = typeof(Program).Assembly.GetName().Name!; var assemblyName = typeof(Program).Assembly.GetName().Name!;
@ -20,12 +21,14 @@ try
.UseSerilog(); .UseSerilog();
builder.Services.AddReverseProxy() builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
builder.Services.AddControllers();
await builder.AddApplicationAsync<InternalGatewayModule>(); await builder.AddApplicationAsync<InternalGatewayModule>();
var app = builder.Build(); var app = builder.Build();
await app.InitializeApplicationAsync(); await app.InitializeApplicationAsync();
app.MapReverseProxy(); app.MapReverseProxy();
app.MapGet("/heath", () => "Online"); app.MapGet("/heath", () => "Online");
app.UseSwaggerUIWithYarp(); app.UseSwaggerUIWithYarp();
app.UseRewriter(new RewriteOptions().AddRedirect("^(|\\|\\s+)$", "/swagger"));
await app.RunAsync(); await app.RunAsync();
return 0; return 0;