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.

19 lines
349 B

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