123456789101112131415161718192021222324 |
- package init_serve
- import (
- "eta_gn/eta_obs/controller"
- _ "eta_gn/eta_obs/docs"
- "eta_gn/eta_obs/global"
- "eta_gn/eta_obs/middleware"
- "github.com/gin-gonic/gin"
- )
- // InitRouter 初始化路由
- func InitRouter() (r *gin.Engine) {
- gin.SetMode(global.CONFIG.Serve.RunMode)
- r = gin.Default()
- r.Use(middleware.Cors())
- r.Use(middleware.Recover())
- // 统一转到obs方法
- obs := controller.ObsController{}
- r.GET("/*path", obs.File)
- return
- }
|