diff options
author | slene <vslene@gmail.com> | 2014-03-23 15:21:56 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-23 15:21:56 +0800 |
commit | 91a1b55707fe959c675fee0c0769a1be0106be3a (patch) | |
tree | d0aad3aaab69b6547d06b8058a10697b76ed19e4 | |
parent | 1c01db4019abc2460ac1743f9675c9effd211e3f (diff) | |
parent | bdd32f152d73f31beffa854fb7382072043ef235 (diff) | |
download | gitea-91a1b55707fe959c675fee0c0769a1be0106be3a.tar.gz gitea-91a1b55707fe959c675fee0c0769a1be0106be3a.zip |
Merge branch 'master' of github.com:gogits/gogs
-rw-r--r-- | routers/dashboard.go | 7 | ||||
-rw-r--r-- | web.go | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/routers/dashboard.go b/routers/dashboard.go index f61d67b7de..dafe9f31ec 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -20,5 +20,12 @@ func Home(ctx *middleware.Context) { func Help(ctx *middleware.Context) { ctx.Data["PageIsHelp"] = true + ctx.Data["Title"] = "Help" ctx.HTML(200, "help") } + +func NotFound(ctx *middleware.Context) { + ctx.Data["PageIsNotFound"] = true + ctx.Data["Title"] = 404 + ctx.Handle(404, "home.NotFound", nil) +} @@ -163,6 +163,9 @@ func runWeb(*cli.Context) { m.Get("/template/**", dev.TemplatePreview) } + // not found handler + m.NotFound(routers.NotFound) + listenAddr := fmt.Sprintf("%s:%s", base.Cfg.MustValue("server", "HTTP_ADDR"), base.Cfg.MustValue("server", "HTTP_PORT", "3000")) |