server_win.go 353 B

123456789101112131415161718192021
  1. //go:build windows
  2. // +build windows
  3. package core
  4. import (
  5. "net/http"
  6. "time"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func initServer(address string, router *gin.Engine) server {
  10. return &http.Server{
  11. Addr: address,
  12. Handler: router,
  13. ReadTimeout: 20 * time.Second,
  14. WriteTimeout: 20 * time.Second,
  15. MaxHeaderBytes: 1 << 20,
  16. }
  17. }