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.

18 lines
353 B

  1. //go:build !windows
  2. // +build !windows
  3. package core
  4. import (
  5. "github.com/fvbock/endless"
  6. "github.com/gin-gonic/gin"
  7. "time"
  8. )
  9. func initServer(address string, router *gin.Engine) server {
  10. s := endless.NewServer(address, router)
  11. s.ReadHeaderTimeout = 10 * time.Millisecond
  12. s.WriteTimeout = 10 * time.Second
  13. s.MaxHeaderBytes = 1 << 20
  14. return s
  15. }