mirror of
https://github.com/prymitive/karma
synced 2026-08-28 11:17:28 +00:00
fix(backend): report listening address in logs
This commit is contained in:
+8
-4
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"mime"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -372,15 +373,18 @@ func main() {
|
||||
go Tick()
|
||||
|
||||
listen := fmt.Sprintf("%s:%d", config.Config.Listen.Address, config.Config.Listen.Port)
|
||||
listener, err := net.Listen("tcp", listen)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Infof("Listening on %s", listener.Addr())
|
||||
|
||||
httpServer := &http.Server{
|
||||
Addr: listen,
|
||||
Handler: router,
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := httpServer.ListenAndServe(); err != nil {
|
||||
log.Infof("Listening on %s", listen)
|
||||
}
|
||||
_ = httpServer.Serve(listener)
|
||||
}()
|
||||
|
||||
quit := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user