routes.go 641 B

123456789101112131415161718192021222324252627282930
  1. package routes
  2. import (
  3. _ "fwh-toolbox-server/docs"
  4. "fwh-toolbox-server/middleware"
  5. "github.com/gofiber/fiber/v2"
  6. "github.com/gofiber/swagger"
  7. )
  8. func Setup(app *fiber.App) {
  9. // 无需验证
  10. AuthSetup(app)
  11. api := app.Group("/api", middleware.AuthMiddleware())
  12. LogoutSetup(api)
  13. // api.Get("/keyAccounts/sunrun/state", controllers.GetUsers)
  14. // api.Get("/keyAccounts/sunrun/abnormalList", controllers.GetUsers)
  15. // …
  16. SitesMonitorSetup(api)
  17. SitesAnalysisSetup(api)
  18. XlogSetup(api)
  19. app.Get("/swagger/*", swagger.HandlerDefault)
  20. // simple health
  21. app.Get("/ping", func(c *fiber.Ctx) error { return c.SendString("pong") })
  22. }