Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Log server start and address

Useful, when port or host is not the default or knowing, when the server started, with chained comands like `go build && ./nyaa`.
Cette révision appartient à :
bakape 2017-05-07 02:58:15 +03:00
Parent f35bd64bec
révision 716659c02a

Voir le fichier

@ -19,11 +19,13 @@ func RunServer(conf *config.Config) {
http.Handle("/", router.Router)
// Set up server,
addr := fmt.Sprintf("%s:%d", conf.Host, conf.Port)
srv := &http.Server{
Addr: fmt.Sprintf("%s:%d", conf.Host, conf.Port),
Addr: addr,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Infof("listening on %s", addr)
err := srv.ListenAndServe()
log.CheckError(err)
@ -47,4 +49,4 @@ func main() {
db.ORM, _ = db.GormInit(conf)
RunServer(conf)
}
}
}