Files
go-zero/rest/internal/starter.go

17 lines
221 B
Go
Raw Normal View History

2020-07-29 18:00:04 +08:00
package internal
2020-07-26 17:09:05 +08:00
import (
"context"
"net/http"
"zero/core/proc"
)
func StartServer(srv *http.Server) error {
proc.AddWrapUpListener(func() {
srv.Shutdown(context.Background())
})
return srv.ListenAndServe()
}