I try to use Swagger with Microsoft WebAPI 2.
For the moment, I\'ve the following call in a method.
appBuilder
.ConfigureOAuth()
.UseWebApi(con
In the Startup.cs file in the Configuration(IAppBuilder app) method I used this line of code to cause it to redirect on load to the swagger welcome page.
app.Run(async context => {
context.Response.Redirect("swagger/ui/index");
});
So the full method I am using is as follows
[assembly: OwinStartup(typeof(AtlasAuthorizationServer.Startup))]
namespace AtlasAuthorizationServer
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
HttpConfiguration config = new HttpConfiguration();
WebApiConfig.Register(config);
app.UseWebApi(config);
app.Run(async context => {
context.Response.Redirect("swagger/ui/index");
});
}
}
}
Note that this is going to cause a green warning in visual studio. I am sure there is some way to mimic this as asynchronous with an await call in the function.