main.go 885 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package main
  2. import (
  3. "fmt"
  4. "os"
  5. _ "github.com/go-sql-driver/mysql"
  6. _ "github.com/lifei6671/godoc/routers"
  7. _ "github.com/astaxie/beego/session/redis"
  8. _ "github.com/astaxie/beego/session/memcache"
  9. _ "github.com/astaxie/beego/session/mysql"
  10. "github.com/astaxie/beego"
  11. "github.com/lifei6671/godoc/commands"
  12. "github.com/lifei6671/godoc/controllers"
  13. "github.com/lifei6671/godoc/conf"
  14. )
  15. var (
  16. VERSION string
  17. BUILD_TIME string
  18. GO_VERSION string
  19. )
  20. func main() {
  21. fmt.Printf("MinDoc version => %s\nbuild time => %s\nstart directory => %s\n%s\n", VERSION, BUILD_TIME, os.Args[0],GO_VERSION)
  22. conf.VERSION = VERSION
  23. commands.RegisterDataBase()
  24. commands.RegisterModel()
  25. commands.RegisterLogger()
  26. commands.RegisterCommand()
  27. commands.RegisterFunction()
  28. beego.SetStaticPath("uploads","uploads")
  29. beego.ErrorController(&controllers.ErrorController{})
  30. beego.Run()
  31. }