1- using System ;
2- using System . Web . Mvc ;
3- using System . Web . Routing ;
4-
5- namespace Bonobo . Git . Server . App_Start
6- {
7- public class RouteConfig
8- {
9- public static void RegisterRoutes ( RouteCollection routes )
10- {
11- routes . MapRoute ( "SecureInfoRefs" ,
12- "{repositoryName}.git/info/refs" ,
13- new { controller = "Git" , action = "SecureGetInfoRefs" } ,
14- new { method = new HttpMethodConstraint ( "GET" ) } ) ;
15-
16- routes . MapRoute ( "SecureUploadPack" ,
17- "{repositoryName}.git/git-upload-pack" ,
18- new { controller = "Git" , action = "SecureUploadPack" } ,
19- new { method = new HttpMethodConstraint ( "POST" ) } ) ;
20-
21- routes . MapRoute ( "SecureReceivePack" ,
22- "{repositoryName}.git/git-receive-pack" ,
23- new { controller = "Git" , action = "SecureReceivePack" } ,
24- new { method = new HttpMethodConstraint ( "POST" ) } ) ;
25-
26- routes . MapRoute ( "GitBaseUrl" ,
27- "{repositoryName}.git" ,
28- new { controller = "Git" , action = "GitUrl" } ,
29- new { method = new HttpMethodConstraint ( "GET" ) } ) ;
30-
31- routes . MapRoute ( "IndexRoute" ,
32- "{controller}/Index/" ,
33- new { action = "Index" } ) ;
34-
35- routes . MapRoute ( "CreateRoute" ,
36- "{controller}/Create/" ,
37- new { action = "Create" } ) ;
38-
39- routes . MapRoute ( "RepositoryTree" ,
40- "Repository/{id}/{encodedName}/Tree/{*encodedPath}" ,
41- new { controller = "Repository" , action = "Tree" } ) ;
42-
43- routes . MapRoute ( "RepositoryBlob" ,
44- "Repository/{id}/{encodedName}/Blob/{*encodedPath}" ,
45- new { controller = "Repository" , action = "Blob" } ,
46- new { id = @"\d+" } ) ;
47-
48- routes . MapRoute ( "RepositoryRaw" ,
49- "Repository/{id}/{encodedName}/Raw/{*encodedPath}" ,
50- new { controller = "Repository" , action = "Raw" } ) ;
51-
52- routes . MapRoute ( "RepositoryBlame" ,
53- "Repository/{id}/{encodedName}/Blame/{*encodedPath}" ,
54- new { controller = "Repository" , action = "Blame" } ) ;
55-
56- routes . MapRoute ( "RepositoryDownload" ,
57- "Repository/{id}/{encodedName}/Download/{*encodedPath}" ,
58- new { controller = "Repository" , action = "Download" } ) ;
59-
60- routes . MapRoute ( "RepositoryCommits" ,
61- "Repository/{id}/{encodedName}/Commits" ,
62- new { controller = "Repository" , action = "Commits" } ) ;
63-
64- routes . MapRoute ( "RepositoryCommit" ,
65- "Repository/{id}/{encodedName}/Commit/{commit}/" ,
66- new { controller = "Repository" , action = "Commit" } ) ;
67-
68- routes . MapRoute ( "RepositoryHistory" ,
69- "Repository/{id}/{encodedName}/History/{*encodedPath}" ,
70- new { controller = "Repository" , action = "History" } ,
71- new { id = @"\d+" } ) ;
72-
73- routes . MapRoute ( "Repository" ,
74- "Repository/{id}/{action}/{reponame}" ,
75- new { controller = "Repository" , action = "Detail" , reponame = UrlParameter . Optional } ,
76- new { id = @"\d+" } ) ;
77-
78- routes . MapRoute ( "Account" ,
79- "Account/{id}/{action}/{username}" ,
80- new { controller = "Account" , action = "Detail" , username = UrlParameter . Optional } ,
81- new { id = @"\d+" } ) ;
82-
83- routes . MapRoute ( "Team" ,
84- "Team/{id}/{action}/{teamname}" ,
85- new { controller = "Team" , action = "Detail" , teamname = UrlParameter . Optional } ,
86- new { id = @"\d+" } ) ;
87-
88-
89- routes . MapRoute ( "Validation" , "Validation/{action}" , new { controller = "Validation" , action = String . Empty } ) ;
90-
91- routes . MapRoute ( "RepoCommits" ,
92- "Repository/Commits/{id}" ,
93- new { controller = "Repository" , action = "Commits" , id = string . Empty } ) ;
94-
95- routes . MapRoute ( "Default" ,
96- "{controller}/{action}/{id}" ,
97- new { controller = "Home" , action = "Index" , id = String . Empty } ) ;
98-
99- routes . IgnoreRoute ( "{*favicon}" , new { favicon = @"(.*/)?favicon.ico(/.*)?" } ) ;
100-
101- routes . IgnoreRoute ( "{resource}.axd/{*pathInfo}" ) ;
102- }
103- }
104- }
1+ //using System;
2+
3+ //namespace Bonobo.Git.Server.App_Start
4+ //{
5+ // public class RouteConfig
6+ // {
7+ // public static void RegisterRoutes(RouteCollection routes)
8+ // {
9+ // //routes.MapRoute("SecureInfoRefs",
10+ // // "{repositoryName}.git/info/refs",
11+ // // new { controller = "Git", action = "SecureGetInfoRefs" },
12+ // // new { method = new HttpMethodConstraint("GET") });
13+
14+ // //routes.MapRoute("SecureUploadPack",
15+ // // "{repositoryName}.git/git-upload-pack",
16+ // // new { controller = "Git", action = "SecureUploadPack" },
17+ // // new { method = new HttpMethodConstraint("POST") });
18+
19+ // //routes.MapRoute("SecureReceivePack",
20+ // // "{repositoryName}.git/git-receive-pack",
21+ // // new { controller = "Git", action = "SecureReceivePack" },
22+ // // new { method = new HttpMethodConstraint("POST") });
23+
24+ // //routes.MapRoute("GitBaseUrl",
25+ // // "{repositoryName}.git",
26+ // // new { controller = "Git", action = "GitUrl" },
27+ // // new { method = new HttpMethodConstraint("GET") });
28+
29+ // routes.MapRoute("IndexRoute",
30+ // "{controller}/Index/",
31+ // new { action = "Index" });
32+
33+ // routes.MapRoute("CreateRoute",
34+ // "{controller}/Create/",
35+ // new { action = "Create" });
36+
37+ // routes.MapRoute("RepositoryTree",
38+ // "Repository/{id}/{encodedName}/Tree/{*encodedPath}",
39+ // new { controller = "Repository", action = "Tree" });
40+
41+ // routes.MapRoute("RepositoryBlob",
42+ // "Repository/{id}/{encodedName}/Blob/{*encodedPath}",
43+ // new { controller = "Repository", action = "Blob" },
44+ // new { id = @"\d+" });
45+
46+ // routes.MapRoute("RepositoryRaw",
47+ // "Repository/{id}/{encodedName}/Raw/{*encodedPath}",
48+ // new { controller = "Repository", action = "Raw" });
49+
50+ // routes.MapRoute("RepositoryBlame",
51+ // "Repository/{id}/{encodedName}/Blame/{*encodedPath}",
52+ // new { controller = "Repository", action = "Blame" });
53+
54+ // routes.MapRoute("RepositoryDownload",
55+ // "Repository/{id}/{encodedName}/Download/{*encodedPath}",
56+ // new { controller = "Repository", action = "Download" });
57+
58+ // routes.MapRoute("RepositoryCommits",
59+ // "Repository/{id}/{encodedName}/Commits",
60+ // new { controller = "Repository", action = "Commits" });
61+
62+ // routes.MapRoute("RepositoryCommit",
63+ // "Repository/{id}/{encodedName}/Commit/{commit}/",
64+ // new { controller = "Repository", action = "Commit" });
65+
66+ // routes.MapRoute("RepositoryHistory",
67+ // "Repository/{id}/{encodedName}/History/{*encodedPath}",
68+ // new { controller = "Repository", action = "History" },
69+ // new { id = @"\d+" });
70+
71+ // routes.MapRoute("Repository",
72+ // "Repository/{id}/{action}/{reponame}",
73+ // new { controller = "Repository", action = "Detail", reponame = UrlParameter.Optional },
74+ // new { id = @"\d+" });
75+
76+ // routes.MapRoute("Account",
77+ // "Account/{id}/{action}/{username}",
78+ // new { controller = "Account", action = "Detail", username = UrlParameter.Optional },
79+ // new { id = @"\d+" });
80+
81+ // routes.MapRoute("Team",
82+ // "Team/{id}/{action}/{teamname}",
83+ // new { controller = "Team", action = "Detail", teamname = UrlParameter.Optional },
84+ // new { id = @"\d+" });
85+
86+
87+ // routes.MapRoute("Validation", "Validation/{action}", new { controller = "Validation", action = String.Empty });
88+
89+ // routes.MapRoute("RepoCommits",
90+ // "Repository/Commits/{id}",
91+ // new { controller = "Repository", action = "Commits", id = string.Empty });
92+
93+ // routes.MapRoute("Default",
94+ // "{controller}/{action}/{id}",
95+ // new { controller = "Home", action = "Index", id = String.Empty });
96+
97+ // routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
98+
99+ // routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
100+ // }
101+ // }
102+ //}
0 commit comments