router.go 590 B

12345678910111213141516171819202122232425262728
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/langgenius/dify-sandbox/internal/middleware"
  5. "github.com/langgenius/dify-sandbox/internal/static"
  6. )
  7. func Setup(eng *gin.Engine) {
  8. eng.Use(middleware.Auth())
  9. eng.POST(
  10. "/v1/sandbox/run",
  11. middleware.MaxRequest(static.GetDifySandboxGlobalConfigurations().MaxRequests),
  12. middleware.MaxWorker(static.GetDifySandboxGlobalConfigurations().MaxWorkers),
  13. RunSandboxController,
  14. )
  15. eng.GET(
  16. "/v1/sandbox/dependencies",
  17. GetDependencies,
  18. )
  19. eng.POST(
  20. "/v1/sandbox/dependencies/update",
  21. UpdateDependencies,
  22. )
  23. }