Skip to content

Commit

Permalink
chore: dev test
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 2, 2022
1 parent c712813 commit 71a6eba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/dev.go
Original file line number Diff line number Diff line change
@@ -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,
})
})
}
4 changes: 4 additions & 0 deletions server/router.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/message"
"github.com/alist-org/alist/v3/server/common"
Expand Down Expand Up @@ -31,6 +32,9 @@ func Init(r *gin.Engine) {

fs(auth.Group("/fs"))
admin(auth.Group("/admin", middlewares.AuthAdmin))
if args.Dev {
dev(r.Group("/dev"))
}
}

func admin(g *gin.RouterGroup) {
Expand Down

0 comments on commit 71a6eba

Please sign in to comment.