TinySkin/server/server.go
thehrz 0b880bece8
All checks were successful
CI / deploy (push) Successful in 57s
pref: rename project
2025-01-24 17:12:15 +08:00

20 lines
375 B
Go

package server
import (
"net/http"
"time"
"tinyskin/config"
)
func NewServer(c config.Config, route http.Handler) (*http.Server, func()) {
s := &http.Server{
ReadTimeout: 10 * time.Second,
ReadHeaderTimeout: 5 * time.Second,
WriteTimeout: 20 * time.Second,
Addr: c.Port,
Handler: route,
}
return s, func() { s.Close() }
}