diff --git a/HttpClientStudy.WebApp/Program.cs b/HttpClientStudy.WebApp/Program.cs index 79c21fd..96b93d2 100644 --- a/HttpClientStudy.WebApp/Program.cs +++ b/HttpClientStudy.WebApp/Program.cs @@ -228,6 +228,14 @@ namespace HttpClientStudy.WebApp app.UseAuthorization(); #endregion + //默认Swagger页 + app.Map("/", async context => + { + context.Response.Redirect($"{context.Request.PathBase}/swagger/index.html"); + + await Task.CompletedTask; + }); + app.Run(); } } diff --git a/HttpClientStudy.WebClient/Program.cs b/HttpClientStudy.WebClient/Program.cs index 32be86b..1ae13f5 100644 --- a/HttpClientStudy.WebClient/Program.cs +++ b/HttpClientStudy.WebClient/Program.cs @@ -51,4 +51,12 @@ applicationLifetime.ApplicationStopped.Register(() => #endregion +//默认Swagger页 +app.Map("/", async context => +{ + context.Response.Redirect($"{context.Request.PathBase}/swagger/index.html"); + + await Task.CompletedTask; +}); + app.Run();