aboutsummaryrefslogtreecommitdiff
path: root/web.go
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-03-23 10:45:06 -0400
committer无闻 <joe2010xtmf@163.com>2014-03-23 10:45:06 -0400
commit8b43bd1c37d740f8670d8502c65918151af24cb8 (patch)
tree6fc09df1b6bef1a73fac40771702ae5f4f71f1d4 /web.go
parentf7f175a0793a53f3c50d20d89e324a610f94c442 (diff)
parent4bac3616055110da6f060e98174bc2381ef91286 (diff)
Merge pull request #32 from shxsun/master
finish gravatar module
Diffstat (limited to 'web.go')
-rw-r--r--web.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/web.go b/web.go
index 9d90851c..d055c394 100644
--- a/web.go
+++ b/web.go
@@ -17,6 +17,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"
@@ -93,6 +94,9 @@ func runWeb(*cli.Context) {
m.Get("/stars", reqSignIn, user.Stars)
m.Get("/help", routers.Help)
+ avatarCache := avatar.HttpHandler("public/img/avatar/", "public/img/avatar/default.jpg")
+ m.Get("/avatar/:hash", avatarCache.ServeHTTP)
+
m.Group("/user", func(r martini.Router) {
r.Any("/login", binding.BindIgnErr(auth.LogInForm{}), user.SignIn)
r.Any("/sign_up", binding.BindIgnErr(auth.RegisterForm{}), user.SignUp)