路由学习2
Posted zslm___
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了路由学习2相关的知识,希望对你有一定的参考价值。
public class RouteConfig { /// <summary> /// RegisterRoutes /// </summary> /// <param name="routes">routes</param> public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( name: "cdnStyle", url: "style/{appVersion}/{appChannel}/{appOs}/{applicablePeople}/{resourceVersion}/{pageCode}.js", defaults: new { controller = "App", action = "Style" }); routes.MapRoute( name: "project", url: "project/{appVersion}/{appChannel}/{appOs}/{pageCode}.js", defaults: new { controller = "App", action = "GetProjects" }); routes.MapRoute( name: "Version", url: "App/Version", defaults: new { controller = "App", action = "Version", id = UrlParameter.Optional }); } }
其他所有路径都会返回404
以上是关于路由学习2的主要内容,如果未能解决你的问题,请参考以下文章
Express实战 - 应用案例- realworld-API - 路由设计 - mongoose - 数据验证 - 密码加密 - 登录接口 - 身份认证 - token - 增删改查API(代码片段