1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 19:10:54 +00:00

warn views can't find when runmode is dev

This commit is contained in:
astaxie 2013-04-11 11:07:32 +08:00
parent 5a48c0ad03
commit cf60a3f463

View File

@ -52,7 +52,7 @@ func init() {
HttpAddr = "" HttpAddr = ""
HttpPort = 8080 HttpPort = 8080
AppName = "beego" AppName = "beego"
RunMode = "prod" //default runmod RunMode = "dev" //default runmod
AutoRender = true AutoRender = true
RecoverPanic = true RecoverPanic = true
PprofOn = false PprofOn = false
@ -80,7 +80,7 @@ func init() {
if runmode := AppConfig.String("runmode"); runmode != "" { if runmode := AppConfig.String("runmode"); runmode != "" {
RunMode = runmode RunMode = runmode
} else { } else {
RunMode = "prod" RunMode = "dev"
} }
if ar, err := AppConfig.Bool("autorender"); err != nil { if ar, err := AppConfig.Bool("autorender"); err != nil {
AutoRender = true AutoRender = true
@ -245,7 +245,9 @@ func Run() {
} }
err := BuildTemplate(ViewsPath) err := BuildTemplate(ViewsPath)
if err != nil { if err != nil {
if RunMode == "dev" {
Warn(err) Warn(err)
} }
}
BeeApp.Run() BeeApp.Run()
} }