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.

34 lines
851 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. address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
  19. s := initServer(address, Router)
  20. // 保证文本顺序输出
  21. // In order to ensure that the text order output can be deleted
  22. time.Sleep(10 * time.Microsecond)
  23. global.GVA_LOG.Debug("server run success on ", address)
  24. fmt.Printf(`欢迎使用 Gin-Vue-Admin
  25. 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
  26. 默认前端文件运行地址:http://127.0.0.1:8080
  27. `, address)
  28. global.GVA_LOG.Error(s.ListenAndServe())
  29. }