router.go 614 B

123456789101112131415161718192021222324
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/lejianwen/rustdesk-api/v2/global"
  5. "github.com/lejianwen/rustdesk-api/v2/http/controller/web"
  6. "net/http"
  7. )
  8. func WebInit(g *gin.Engine) {
  9. i := &web.Index{}
  10. g.GET("/", i.Index)
  11. if global.Config.App.WebClient == 1 {
  12. g.GET("/webclient-config/index.js", i.ConfigJs)
  13. }
  14. if global.Config.App.WebClient == 1 {
  15. g.StaticFS("/webclient", http.Dir(global.Config.Gin.ResourcesPath+"/web"))
  16. g.StaticFS("/webclient2", http.Dir(global.Config.Gin.ResourcesPath+"/web2"))
  17. }
  18. g.StaticFS("/_admin", http.Dir(global.Config.Gin.ResourcesPath+"/admin"))
  19. }