main.go 540 B

123456789101112131415161718192021222324252627
  1. package main
  2. import (
  3. "base-gin/conf"
  4. "base-gin/helpers"
  5. "base-gin/router"
  6. "base-gin/utils"
  7. "fmt"
  8. "github.com/fvbock/endless"
  9. "github.com/gin-gonic/gin"
  10. )
  11. func main() {
  12. r := gin.New()
  13. //启动配置
  14. utils.Bootstrap(r, utils.BootstrapConf{LogLevel: conf.Conf.LogLevel})
  15. //设置日志级别
  16. //level, err := logrus.ParseLevel(conf.Conf.LogLevel)
  17. //if err != nil {
  18. // level = logrus.DebugLevel
  19. //}
  20. //logrus.SetLevel(level)
  21. helpers.InitMysql()
  22. router.Http(r)
  23. fmt.Println("hello world")
  24. endless.ListenAndServe(":80", r)
  25. }