Albirew/nyaa-pantsu
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 14dfbc91ca
révision 919e6fc659
1 fichiers modifiés avec 4 ajouts et 2 suppressions

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)
}
}
}