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.

37 lines
897 B

  1. package core
  2. import (
  3. "fmt"
  4. "gin-vue-admin/global"
  5. "gin-vue-admin/initialize"
  6. "time"
  7. )
  8. type server interface {
  9. ListenAndServe() error
  10. }
  11. func RunWindowsServer() {
  12. if global.GVA_CONFIG.System.UseMultipoint {
  13. // 初始化redis服务
  14. initialize.Redis()
  15. }
  16. Router := initialize.Routers()
  17. Router.Static("/form-generator", "./resource/page")
  18. //InstallPlugs(Router)
  19. // end 插件描述
  20. address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
  21. s := initServer(address, Router)
  22. // 保证文本顺序输出
  23. // In order to ensure that the text order output can be deleted
  24. time.Sleep(10 * time.Microsecond)
  25. global.GVA_LOG.Debug("server run success on ", address)
  26. fmt.Printf(`欢迎使用 Gin-Vue-Admin
  27. 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
  28. 默认前端文件运行地址:http://127.0.0.1:8080
  29. `, address)
  30. global.GVA_LOG.Error(s.ListenAndServe())
  31. }