go-zero/ngin/internal/starter.go
2020-07-29 18:00:08 +08:00

17 lines
221 B
Go

package internal
import (
"context"
"net/http"
"zero/core/proc"
)
func StartServer(srv *http.Server) error {
proc.AddWrapUpListener(func() {
srv.Shutdown(context.Background())
})
return srv.ListenAndServe()
}