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.
cloudreve/routers/router.go

27 lines
455 B

5 years ago
package routers
import (
5 years ago
"cloudreve/middleware"
"cloudreve/pkg/conf"
"cloudreve/routers/controllers"
5 years ago
"github.com/gin-gonic/gin"
)
func InitRouter() *gin.Engine {
r := gin.Default()
5 years ago
// 中间件
r.Use(middleware.Session(conf.SystemConfig.SessionSecret))
// 顶层路由分组
5 years ago
v3 := r.Group("/Api/V3")
{
// 测试用路由
5 years ago
v3.GET("Ping", controllers.Ping)
// 用户登录
5 years ago
v3.POST("User/Session", controllers.UserLogin)
5 years ago
}
return r
}