aboutsummaryrefslogtreecommitdiff
path: root/cmd/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 55b6bf08..1b692ceb 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -55,6 +55,7 @@ and it takes care of all the other things for you`,
Action: runWeb,
Flags: []cli.Flag{
cli.StringFlag{"port, p", "3000", "Temporary port number to prevent conflict", ""},
+ cli.StringFlag{"config, c", "custom/conf/app.ini", "Custom configuration file path", ""},
},
}
@@ -78,7 +79,7 @@ func checkVersion() {
// Check dependency version.
checkers := []VerChecker{
{"github.com/Unknwon/macaron", macaron.Version, "0.5.1"},
- {"github.com/macaron-contrib/binding", binding.Version, "0.0.4"},
+ {"github.com/macaron-contrib/binding", binding.Version, "0.0.5"},
{"github.com/macaron-contrib/cache", cache.Version, "0.0.7"},
{"github.com/macaron-contrib/csrf", csrf.Version, "0.0.3"},
{"github.com/macaron-contrib/i18n", i18n.Version, "0.0.5"},
@@ -165,6 +166,9 @@ func newMacaron() *macaron.Macaron {
}
func runWeb(ctx *cli.Context) {
+ if ctx.IsSet("config") {
+ setting.CustomConf = ctx.String("config")
+ }
routers.GlobalInit()
checkVersion()
@@ -225,7 +229,7 @@ func runWeb(ctx *cli.Context) {
})
m.Any("/*", func(ctx *middleware.Context) {
- ctx.JSON(404, &base.ApiJsonErr{"Not Found", base.DOC_URL})
+ ctx.HandleAPI(404, "Page not found")
})
})
})