mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-02 05:50:24 +08:00
代码优化
This commit is contained in:
17
base/starter/web-server.go
Normal file
17
base/starter/web-server.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package starter
|
||||
|
||||
import (
|
||||
"mayfly-go/base/global"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RunWebServer(web *gin.Engine) {
|
||||
port := global.Config.Server.GetPort()
|
||||
if app := global.Config.App; app != nil {
|
||||
global.Log.Infof("%s- Listening and serving HTTP on %s", app.GetAppInfo(), port)
|
||||
} else {
|
||||
global.Log.Infof("Listening and serving HTTP on %s", port)
|
||||
}
|
||||
web.Run(port)
|
||||
}
|
||||
Reference in New Issue
Block a user