main.go 416 B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "eta/eta_report/controllers"
  4. _ "eta/eta_report/routers"
  5. "eta/eta_report/services"
  6. "github.com/beego/beego/v2/server/web"
  7. )
  8. func main() {
  9. if web.BConfig.RunMode == "dev" {
  10. web.BConfig.WebConfig.DirectoryIndex = true
  11. web.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
  12. }
  13. go services.InitTask()
  14. // 异常处理
  15. web.ErrorController(&controllers.ErrorController{})
  16. web.Run()
  17. }