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.

23 lines
334 B

7 months ago
package main
import (
7 months ago
"cmsDemo/handlers"
7 months ago
"cmsDemo/models"
"cmsDemo/utils"
"github.com/spf13/viper"
"log"
)
func main() {
// 解析配置
utils.ParseConfig()
utils.InitDB()
models.Migrate()
// 启动监听
7 months ago
router := handlers.Router()
7 months ago
if err := router.Run(viper.GetString("app.addr")); err != nil {
log.Fatal(err)
}
}