You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
429 B
21 lines
429 B
package main
|
|
|
|
import (
|
|
"ginCms/handelers"
|
|
"ginCms/utils"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func main() {
|
|
//解析配置
|
|
utils.ParseConfig()
|
|
//设置模式
|
|
utils.SetMode()
|
|
//设置日志
|
|
utils.SetLogger()
|
|
//初始化路由引擎
|
|
r := handelers.InitEngine()
|
|
utils.Logger().Info("server is listening on ", "addr", viper.GetString("app.addr"))
|
|
r.Run(viper.GetString("app.addr")) // 监听并在 0.0.0.0:8080 上启动服务
|
|
}
|