Replace multiconfig with cobra+viper

This commit is contained in:
Deluan 2020-07-02 16:34:21 -04:00
parent fea060e4f2
commit 5021c0fd0c
10 changed files with 275 additions and 197 deletions

22
main.go
View file

@ -1,25 +1,7 @@
package main
import (
"fmt"
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/consts"
"github.com/deluan/navidrome/db"
)
import "github.com/deluan/navidrome/cmd"
func main() {
println(consts.Banner())
conf.Load()
db.EnsureLatestVersion()
subsonic, err := CreateSubsonicAPIRouter()
if err != nil {
panic(fmt.Sprintf("Could not create the Subsonic API router. Aborting! err=%v", err))
}
a := CreateServer(conf.Server.MusicFolder)
a.MountRouter(consts.URLPathSubsonicAPI, subsonic)
a.MountRouter(consts.URLPathUI, CreateAppRouter())
a.Run(":" + conf.Server.Port)
cmd.Execute()
}