feat: PORT env var can override configured port

This commit is contained in:
Deluan 2020-01-26 22:18:30 -05:00
parent b7d7251cf4
commit ac4aa1ebe2
1 changed files with 3 additions and 0 deletions

View File

@ -84,6 +84,9 @@ func LoadFromFile(confFile string, skipFlags ...bool) {
if Server.DbPath == "" {
Server.DbPath = filepath.Join(Server.DataFolder, "navidrome.db")
}
if os.Getenv("PORT") != "" {
Server.Port = os.Getenv("PORT")
}
log.SerLevelString(Server.LogLevel)
log.Trace("Loaded configuration", "file", confFile, "config", fmt.Sprintf("%#v", Server))
}