mirror of
https://github.com/yv1ing/MollyBlog.git
synced 2025-09-16 14:53:45 +08:00
fix: Set whether to enable debug mode
This commit is contained in:
@@ -46,10 +46,16 @@ func init() {
|
|||||||
gin.SetMode(gin.ReleaseMode)
|
gin.SetMode(gin.ReleaseMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ma *MApp) Run() {
|
func (ma *MApp) Run(debug bool) {
|
||||||
ma.loadRoutes()
|
ma.loadRoutes()
|
||||||
ma.loadTemplates()
|
ma.loadTemplates()
|
||||||
|
|
||||||
|
if debug {
|
||||||
|
gin.SetMode(gin.DebugMode)
|
||||||
|
} else {
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
}
|
||||||
|
|
||||||
addr := fmt.Sprintf("%s:%d", ma.Host, ma.Port)
|
addr := fmt.Sprintf("%s:%d", ma.Host, ma.Port)
|
||||||
log.Printf("app listening on %s\n", addr)
|
log.Printf("app listening on %s\n", addr)
|
||||||
err := ma.engine.Run(addr)
|
err := ma.engine.Run(addr)
|
||||||
|
|||||||
Reference in New Issue
Block a user