main.go 386B

12345678910111213141516171819
  1. package main
  2. import (
  3. _ "sws_xcx/routers"
  4. "sws_xcx/service"
  5. "github.com/astaxie/beego"
  6. )
  7. func main() {
  8. service.ConnectDB()
  9. beego.BConfig.WebConfig.DirectoryIndex = true
  10. if beego.BConfig.RunMode == "dev" || beego.BConfig.RunMode == "test" {
  11. beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
  12. }
  13. beego.BConfig.WebConfig.StaticDir["/asserts"] = "asserts"
  14. beego.Run()
  15. }