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
23 lines
334 B
package main
|
|
|
|
import (
|
|
"cmsDemo/handlers"
|
|
"cmsDemo/models"
|
|
"cmsDemo/utils"
|
|
"github.com/spf13/viper"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
// 解析配置
|
|
utils.ParseConfig()
|
|
utils.InitDB()
|
|
models.Migrate()
|
|
|
|
// 启动监听
|
|
router := handlers.Router()
|
|
if err := router.Run(viper.GetString("app.addr")); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|