Reputation: 993
I have created a Web Api, and I want to set default landing url as Swagger url i.e:- http://localhost:65347/swagger/ui/index
Upvotes: 4
Views: 5443
Reputation: 1893
Maybe not the most accurate answer, but I simply set the Startup URL in my project to the Swagger page. You'll have to make sure the path is correct when you deploy, but works great for me when debugging on my workstation.....
Upvotes: 3
Reputation: 993
I have resolved this by adding below code in RouteConfig.cs
routes.MapHttpRoute( name: "swagger", routeTemplate: "", defaults: null, constraints: null, handler: new RedirectHandler((url => url.RequestUri.ToString()), "swagger"));
Upvotes: 3