summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-18 01:33:53 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-18 01:33:53 -0400
commita3a93aef11f9ff6eca38e9147b022a0649b73bdf (patch)
treeb669aadf733d04b5f2661ee1c7014760f0a6ac6c /web.go
parentd886f4df9734ccf69647dfb5564effaca85fed50 (diff)
downloadgitea-a3a93aef11f9ff6eca38e9147b022a0649b73bdf.tar.gz
gitea-a3a93aef11f9ff6eca38e9147b022a0649b73bdf.zip
Add some config options
Diffstat (limited to 'web.go')
-rw-r--r--web.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/web.go b/web.go
index ca504ea560..cc20097907 100644
--- a/web.go
+++ b/web.go
@@ -8,6 +8,7 @@ import (
"fmt"
"html/template"
"net/http"
+ "strings"
"github.com/codegangsta/cli"
"github.com/codegangsta/martini"
@@ -34,8 +35,20 @@ gogs web`,
Flags: []cli.Flag{},
}
+// 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 runWeb(*cli.Context) {
log.Info("%s %s", base.AppName, base.AppVer)
+ checkRunMode()
m := martini.Classic()