How to set Swagger as default start page?

Cristina Pereira Cunha picture Cristina Pereira Cunha · Nov 23, 2017 · Viewed 14.8k times · Source

How do I set Swagger as the default start page in ABP template instead of /Account/Login?

I'm using ASP.NET MVC 5.x + Angular 1.x.

Update

Current code:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    //ASP.NET Web API Route Config
    routes.MapHttpRoute(
        name: "swagger_root",
        routeTemplate: "",
        defaults: null,
        constraints: null,
        handler: new RedirectHandler((message => message.RequestUri.ToString()), "swagger"));

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

Everything is still working fine, except Module Zero's "api/Account/Authenticate" request that has broken, showing:

The resource cannot be found.

Answer

JimbobTheSailor picture JimbobTheSailor · Oct 31, 2019

For a RESTFUL API in ASP Net Core >2.2, set the default URL in Project/Properties/ Debug

Default URL In Resful API dot net core 2.2