package main import ( "context" "flag" "net/http" "git.blauwelle.com/go/crate/exegroup" "git.blauwelle.com/go/crate/log" "git.blauwelle.com/go/crate/log/logsdk" "git.blauwelle.com/go/crate/log/logsdk/logjson" ) var port = flag.Int("port", 8080, "HTTP Port") func main() { flag.Parse() log.Logger().AddProcessor(logsdk.AllLevels, logjson.New()) g := exegroup.Default() mux := http.NewServeMux() var handler http.Handler = mux mux.HandleFunc("/", newHandler()) g.New().WithGoStop(exegroup.HttpListenAndServe(*port, handler)) log.Infof(context.Background(), "listening %d", *port) log.Error(context.Background(), "exit: ", g.Run(context.Background())) }