package main

import (
	"demo/configs"
	"demo/router"
	"demo/util/templatefunc"
	"github.com/gin-gonic/gin"
	"net/http"
)

func init() {
	configs.ConfigInit()
}
func main() {
	runGin()
}

// 接口前缀

func runGin() {
	Router := gin.Default()
	apiGroup := Router.Group(router.Prefix)
	Router.SetFuncMap(templatefunc.BaseTemplateFunc())
	//加载模板
	Router.LoadHTMLGlob("file/static/*")
	apiGroup.StaticFS("/static", http.Dir("file/resources"))
	apiGroup.StaticFS("/assets", http.Dir("file/assets"))
	router.InitRouter(apiGroup)
	router.InitAuthority(Router)
	Router.Run(":8182")
}
