diff options
author | Gogs <gogitservice@gmail.com> | 2014-03-23 11:13:23 +0100 |
---|---|---|
committer | Gogs <gogitservice@gmail.com> | 2014-03-23 11:13:23 +0100 |
commit | 964e537479c497a5ba42799a1c1a7c430720e990 (patch) | |
tree | b375f9a485ad08495a9e178bfe7d720d55febead /web.go | |
parent | fix download part problem, add png support (diff) | |
download | forgejo-964e537479c497a5ba42799a1c1a7c430720e990.tar.xz forgejo-964e537479c497a5ba42799a1c1a7c430720e990.zip |
append route to web
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -18,6 +18,7 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" + "github.com/gogits/gogs/modules/avatar" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/mailer" @@ -114,6 +115,9 @@ func runWeb(*cli.Context) { m.Get("/help", routers.Help) + avatarHandler := avatar.HttpHandler("public/img/avatar", "public/img/avatar/default.jpg") + m.Get("/avatar/:hash", avatarHandler.ServeHTTP) + adminReq := middleware.AdminRequire() m.Get("/admin", reqSignIn, adminReq, admin.Dashboard) m.Get("/admin/users", reqSignIn, adminReq, admin.Users) @@ -136,7 +140,6 @@ func runWeb(*cli.Context) { ignSignIn, middleware.RepoAssignment(true), repo.Single) m.Get("/:username/:reponame/commit/:commitid/**", ignSignIn, middleware.RepoAssignment(true), repo.Single) m.Get("/:username/:reponame/commit/:commitid", ignSignIn, middleware.RepoAssignment(true), repo.Single) - m.Get("/:username/:reponame", ignSignIn, middleware.RepoAssignment(true), repo.Single) m.Any("/:username/:reponame/**", ignSignIn, repo.Http) |