1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Refactor builders

This commit is contained in:
Maksym Pavlenko
2019-10-29 12:50:06 -07:00
parent 7168f6e8df
commit acee1d9cfc
16 changed files with 446 additions and 421 deletions

View File

@@ -47,15 +47,17 @@ func main() {
}
// Create web server
if cfg.Port == 0 {
log.Debug("using default port 8080")
cfg.Port = 8080
port := cfg.Server.Port
if port == 0 {
port = 8080
}
srv := http.Server{
Addr: fmt.Sprintf(":%d", cfg.Port),
Addr: fmt.Sprintf(":%d", port),
}
log.Debugf("using address %s", srv.Addr)
// Run listener
go func() {
log.Infof("running listener at %s", srv.Addr)