This commit is contained in:
Mihail Slobodyanuk 2022-12-22 10:00:25 +02:00
parent e253b64d43
commit 006a564bf5
2 changed files with 8 additions and 2 deletions

View file

@ -276,6 +276,9 @@ func run(args yggArgs, ctx context.Context) {
logger.Errorln(err)
} else {
err = n.rest_server.Serve()
if err != nil {
logger.Errorln(err)
}
}
}

View file

@ -97,7 +97,10 @@ func (a *RestServer) Serve() error {
a.Log.Infof("Http server is listening on %s and is supplied from %s %s\n", a.ListenAddress, a.docFsType, a.WwwRoot)
}
go func() {
a.Log.Errorln(http.Serve(l, nil))
err := http.Serve(l, nil)
if err != nil {
a.Log.Errorln(err)
}
}()
return nil
}
@ -216,7 +219,7 @@ func (a *RestServer) apiPeersHandler(w http.ResponseWriter, r *http.Request) {
}
fmt.Fprint(w, string(b[:]))
case "POST":
handlePost()
_ = handlePost()
case "PUT":
if handleDelete() == nil {
if handlePost() == nil {