initial import
This commit is contained in:
16
core/httpserver/starter.go
Normal file
16
core/httpserver/starter.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package httpserver
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"zero/core/proc"
|
||||
)
|
||||
|
||||
func StartServer(srv *http.Server) error {
|
||||
proc.AddWrapUpListener(func() {
|
||||
srv.Shutdown(context.Background())
|
||||
})
|
||||
|
||||
return srv.ListenAndServe()
|
||||
}
|
||||
Reference in New Issue
Block a user