JM-WechatMini/core/server_other.go

20 lines
349 B
Go
Raw Permalink Normal View History

2023-11-02 04:34:46 +08:00
//go:build !windows
// +build !windows
package core
import (
"time"
"github.com/fvbock/endless"
"github.com/gin-gonic/gin"
)
func initServer(address string, router *gin.Engine) server {
s := endless.NewServer(address, router)
s.ReadHeaderTimeout = 20 * time.Second
s.WriteTimeout = 20 * time.Second
s.MaxHeaderBytes = 1 << 20
return s
}