Cloudreve/routers/router.go

22 lines
332 B
Go
Raw Normal View History

2019-11-05 12:31:22 +08:00
package routers
import (
"cloudreve/routers/controllers"
2019-11-05 12:31:22 +08:00
"github.com/gin-gonic/gin"
)
func InitRouter() *gin.Engine {
r := gin.Default()
2019-11-05 19:49:56 +08:00
// 顶层路由分组
2019-11-05 12:31:22 +08:00
v3 := r.Group("/Api/V3")
{
2019-11-05 19:49:56 +08:00
// 测试用路由
2019-11-05 12:31:22 +08:00
v3.GET("Ping", controllers.Ping)
2019-11-05 19:49:56 +08:00
// 用户登录
v3.POST("User/Login", controllers.UserLogin)
2019-11-05 12:31:22 +08:00
}
return r
}