chore: dev test
This commit is contained in:
parent
c7128133d6
commit
71a6ebaf43
15
server/dev.go
Normal file
15
server/dev.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/alist-org/alist/v3/server/middlewares"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func dev(g *gin.RouterGroup) {
|
||||||
|
g.GET("/path/*path", middlewares.Down, func(ctx *gin.Context) {
|
||||||
|
rawPath := ctx.MustGet("path").(string)
|
||||||
|
ctx.JSON(200, gin.H{
|
||||||
|
"path": rawPath,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/alist-org/alist/v3/cmd/args"
|
||||||
"github.com/alist-org/alist/v3/internal/conf"
|
"github.com/alist-org/alist/v3/internal/conf"
|
||||||
"github.com/alist-org/alist/v3/internal/message"
|
"github.com/alist-org/alist/v3/internal/message"
|
||||||
"github.com/alist-org/alist/v3/server/common"
|
"github.com/alist-org/alist/v3/server/common"
|
||||||
@ -31,6 +32,9 @@ func Init(r *gin.Engine) {
|
|||||||
|
|
||||||
fs(auth.Group("/fs"))
|
fs(auth.Group("/fs"))
|
||||||
admin(auth.Group("/admin", middlewares.AuthAdmin))
|
admin(auth.Group("/admin", middlewares.AuthAdmin))
|
||||||
|
if args.Dev {
|
||||||
|
dev(r.Group("/dev"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func admin(g *gin.RouterGroup) {
|
func admin(g *gin.RouterGroup) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user