设置默认启始页

main
bicijinlian 8 months ago
parent bb01db099f
commit 1f355c6b24

@ -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();
}
}

@ -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();

Loading…
Cancel
Save