You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
572 B

5 years ago
5 years ago
5 years ago
  1. package main
  2. import (
  3. "main/config"
  4. "main/init/initRouter"
  5. "main/init/qmlog"
  6. "main/init/qmsql"
  7. "main/init/registTable"
  8. "net/http"
  9. "time"
  10. )
  11. func main() {
  12. qmlog.InitLog()
  13. registTable.RegistTable(qmsql.InitMysql(config.Dbconfig.Admin))
  14. defer qmsql.DEFAULTDB.Close()
  15. Router := initRouter.InitRouter()
  16. //qmlog.QMLog.Info("服务器开启") // 日志测试代码
  17. s := &http.Server{
  18. Addr: ":8888",
  19. Handler: Router,
  20. ReadTimeout: 10 * time.Second,
  21. WriteTimeout: 10 * time.Second,
  22. MaxHeaderBytes: 1 << 20,
  23. }
  24. _ = s.ListenAndServe()
  25. }