diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-29 17:50:51 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-29 17:50:51 -0400 |
commit | 107a1eadac72e610a9bcb68498751ca51ec8f51a (patch) | |
tree | 07830d247f89887882427c0bb910178bde4298ce /web.go | |
parent | 1f671e5d2900497e2c81e8123cc47fe7ca5ad371 (diff) | |
download | gitea-107a1eadac72e610a9bcb68498751ca51ec8f51a.tar.gz gitea-107a1eadac72e610a9bcb68498751ca51ec8f51a.zip |
Finish close and reopen issue, install page, ready going to test stage of v0.2.0
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 28 |
1 files changed, 1 insertions, 27 deletions
@@ -8,19 +8,16 @@ import ( "fmt" "html/template" "net/http" - "strings" "github.com/codegangsta/cli" "github.com/codegangsta/martini" "github.com/gogits/binding" - "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" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/routers" "github.com/gogits/gogs/routers/admin" @@ -40,27 +37,6 @@ and it takes care of all the other things for you`, Flags: []cli.Flag{}, } -// globalInit is for global configuration reload-able. -func globalInit() { - base.NewConfigContext() - mailer.NewMailerContext() - models.LoadModelsConfig() - models.LoadRepoConfig() - models.NewRepoContext() - models.NewEngine() -} - -// Check run mode(Default of martini is Dev). -func checkRunMode() { - switch base.Cfg.MustValue("", "RUN_MODE") { - case "prod": - martini.Env = martini.Prod - case "test": - martini.Env = martini.Test - } - log.Info("Run Mode: %s", strings.Title(martini.Env)) -} - func newMartini() *martini.ClassicMartini { r := martini.NewRouter() m := martini.New() @@ -74,9 +50,7 @@ func newMartini() *martini.ClassicMartini { func runWeb(*cli.Context) { fmt.Println("Server is running...") - globalInit() - base.NewServices() - checkRunMode() + routers.GlobalInit() log.Info("%s %s", base.AppName, base.AppVer) m := newMartini() |