How to use Swagger as Welcome Page of IAppBuilder in WebAPI

后端 未结 12 1518
遥遥无期
遥遥无期 2020-12-24 05:59

I try to use Swagger with Microsoft WebAPI 2.

For the moment, I\'ve the following call in a method.

appBuilder
   .ConfigureOAuth()
   .UseWebApi(con         


        
12条回答
  •  萌比男神i
    2020-12-24 07:00

    In ASP.NET Core, you can simply just change the RoutePrefix when registering SwaggerUI to empty string.

    app.UseSwaggerUI(c =>
    {
        c.RoutePrefix = "";
        ...
    };
    

    No redirect configuration required, unless you still want /swagger or something similar in the path.

提交回复
热议问题