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