summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorGogs <gogitservice@gmail.com>2014-03-23 11:13:23 +0100
committerGogs <gogitservice@gmail.com>2014-03-23 11:13:23 +0100
commit964e537479c497a5ba42799a1c1a7c430720e990 (patch)
treeb375f9a485ad08495a9e178bfe7d720d55febead /web.go
parentfix download part problem, add png support (diff)
downloadforgejo-964e537479c497a5ba42799a1c1a7c430720e990.tar.xz
forgejo-964e537479c497a5ba42799a1c1a7c430720e990.zip
append route to web
Diffstat (limited to 'web.go')
-rw-r--r--web.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/web.go b/web.go
index bb316a6724..637ee7ce95 100644
--- a/web.go
+++ b/web.go
@@ -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)