projectx/cmd/server_other.go
2025-03-21 11:05:42 +08:00

20 lines
333 B
Go

//go:build !windows
// +build !windows
package cmd
import (
"net/http"
"time"
"github.com/fvbock/endless"
)
func InitServer(address string, router http.Handler) server {
s := endless.NewServer(address, router)
s.ReadHeaderTimeout = 20 * time.Second
s.WriteTimeout = 20 * time.Second
s.MaxHeaderBytes = 1 << 20
return s
}