main.go 372 B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "iot_manager_service/app/dao"
  5. "iot_manager_service/config"
  6. _ "iot_manager_service/config"
  7. "iot_manager_service/router"
  8. )
  9. func main() {
  10. // 开始调试模式
  11. gin.SetMode("debug")
  12. // 实例化配置
  13. dao.InitDB()
  14. engine := gin.Default()
  15. router.InitRouter(engine)
  16. engine.Run(config.Instance().Server.Address)
  17. }