小编Cri*_*nha的帖子

如何将Swagger设置为默认开始页面?

如何将Swagger设置为ABP模板中的默认起始页而不是/Account/Login

我正在使用ASP.NET MVC 5.x + Angular 1.x.

更新

当前代码:

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 }
    );
}
Run Code Online (Sandbox Code Playgroud)

一切都工作正常,除了模块零的"api/Account/Authenticate"请求已经破坏,显示:

无法找到该资源.

c# angularjs asp.net-mvc-5 swagger-ui aspnetboilerplate

7
推荐指数
7
解决办法
4992
查看次数