Thursday, July 12, 2018

ASP.NET Web API–Redirect root page to swagger

By default when you add Swagger (through SwashBuckle) in your ASP.NET Web API project, the swagger UI is available on following url: https://localhost:44300/swagger .

However because this project was only hosting this API, we wanted to show the Swagger UI on the root page. To get this working we added another route to our WebApiConfig.cs file:

No comments: