23 lines
504 B
Go
23 lines
504 B
Go
package routers
|
|
|
|
import (
|
|
"gin-server/security/controller"
|
|
"github.com/appleboy/gin-revision-middleware"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/swaggo/gin-swagger"
|
|
"github.com/swaggo/gin-swagger/swaggerFiles"
|
|
)
|
|
|
|
// InitRouter initialize routing information
|
|
func InitRouter() *gin.Engine {
|
|
r := gin.New()
|
|
r.Use(gin.Logger())
|
|
r.Use(gin.Recovery())
|
|
r.Use(revision.Middleware())
|
|
|
|
r.GET("/auth", controller.GetAuth)
|
|
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
|
|
|
return r
|
|
}
|