windows.go 657 B

123456789101112131415161718192021222324252627
  1. package cmd
  2. import (
  3. "fmt"
  4. "gin-vue-admin/config"
  5. "github.com/gin-gonic/gin"
  6. "net/http"
  7. "time"
  8. )
  9. func RunWindowsServer(Router *gin.Engine) {
  10. s := &http.Server{
  11. Addr: fmt.Sprintf(":%d", config.GinVueAdminconfig.System.Addr),
  12. Handler: Router,
  13. ReadTimeout: 10 * time.Second,
  14. WriteTimeout: 10 * time.Second,
  15. MaxHeaderBytes: 1 << 20,
  16. }
  17. time.Sleep(10 * time.Microsecond)
  18. fmt.Printf(`欢迎使用 Gin-Vue-Admin
  19. 作者:奇淼 And Spike666
  20. 微信:shouzi_1994
  21. 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
  22. 默认前端文件运行地址:http://127.0.0.1:8080
  23. `, s.Addr)
  24. _ = s.ListenAndServe()
  25. }