mirror of https://github.com/Xhofe/alist
				
				
				
			chore: dev test
							parent
							
								
									c7128133d6
								
							
						
					
					
						commit
						71a6ebaf43
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue