12345678910111213141516171819 |
- package app
- import (
- middlewares "Panel_development/app/middleware"
- "Panel_development/app/routers"
- "Panel_development/global"
- "github.com/gin-gonic/gin"
- )
- func InitRouter() error {
- engine := gin.New()
- engine.Use(middlewares.LoginMiddleware())
- gin.SetMode(global.ServerSetting.Mode)
- routers.AdminRouter(engine)
- routers.ComponentClassRouter(engine)
- routers.ComponentListRouter(engine)
- routers.PageManageRouter(engine)
- return engine.Run(global.ServerSetting.Port)
- }
|