raw download

This commit is contained in:
slene 2014-03-24 23:56:32 +08:00
parent 92a6058e29
commit ff36248419
4 changed files with 77 additions and 20 deletions

2
web.go
View file

@ -152,6 +152,7 @@ func runWeb(*cli.Context) {
r.Get("/branches", repo.Branches)
r.Get("/src/:branchname", repo.Single)
r.Get("/src/:branchname/**", repo.Single)
r.Get("/raw/:branchname/**", repo.SingleDownload)
r.Get("/commits/:branchname", repo.Commits)
r.Get("/commits/:branchname", repo.Commits)
}, ignSignIn, middleware.RepoAssignment(true))
@ -161,6 +162,7 @@ func runWeb(*cli.Context) {
m.Get("/:username/:reponame/commit/:commitid", ignSignIn, middleware.RepoAssignment(true), repo.Diff)
m.Group("/:username", func(r martini.Router) {
r.Get("/:reponame", middleware.RepoAssignment(true), repo.Single)
r.Get("/:reponame", middleware.RepoAssignment(true), repo.Single)
r.Any("/:reponame/**", repo.Http)
}, ignSignIn)