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.

30 lines
556 B

5 years ago
package main
import (
"github.com/gin-gonic/gin"
"live/app/lib/config"
"live/app/router"
5 years ago
"live/app/task"
5 years ago
"log"
)
func main() {
if config.Config.Section("").Key("debug").MustBool() {
gin.ForceConsoleColor()
} else {
gin.SetMode(gin.ReleaseMode)
}
r := gin.Default()
5 years ago
if !config.Config.Section("").Key("debug").MustBool() {
// 直播主动拿回调任务
go task.Run()
}
5 years ago
5 years ago
// 路由配置
router.Router(r)
if err := r.Run(config.Config.Section("").Key("addr").String()); err != nil {
log.Fatal("服务启动失败err:", err)
}
}