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.

25 lines
476 B

  1. package main
  2. import (
  3. "main/config"
  4. "main/init/initRouter"
  5. "main/init/mysql"
  6. "main/init/registTable"
  7. "net/http"
  8. "time"
  9. )
  10. func main() {
  11. registTable.RegistTable(mysql.InitMysql(config.Dbconfig.Admin))
  12. defer mysql.DEFAULTDB.Close()
  13. Router := initRouter.InitRouter()
  14. s := &http.Server{
  15. Addr: ":8888",
  16. Handler: Router,
  17. ReadTimeout: 10 * time.Second,
  18. WriteTimeout: 10 * time.Second,
  19. MaxHeaderBytes: 1 << 20,
  20. }
  21. _ = s.ListenAndServe()
  22. }