2016-02-23 18:41:35 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2020-02-20 19:08:10 -05:00
|
|
|
"fmt"
|
|
|
|
|
|
2020-01-23 19:44:08 -05:00
|
|
|
"github.com/deluan/navidrome/conf"
|
2020-02-04 10:14:53 -05:00
|
|
|
"github.com/deluan/navidrome/consts"
|
2020-01-28 08:22:17 -05:00
|
|
|
"github.com/deluan/navidrome/db"
|
2016-02-23 18:41:35 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2020-03-22 01:13:55 -04:00
|
|
|
println(consts.Banner())
|
2020-01-20 17:35:04 -05:00
|
|
|
|
2020-01-26 16:21:07 -05:00
|
|
|
conf.Load()
|
2020-02-01 13:46:03 -05:00
|
|
|
db.EnsureLatestVersion()
|
2020-01-26 16:21:07 -05:00
|
|
|
|
2020-02-20 19:08:10 -05:00
|
|
|
subsonic, err := CreateSubsonicAPIRouter()
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(fmt.Sprintf("Could not create the Subsonic API router. Aborting! err=%v", err))
|
|
|
|
|
}
|
2020-01-24 01:29:31 -05:00
|
|
|
a := CreateServer(conf.Server.MusicFolder)
|
2020-04-03 17:50:42 -04:00
|
|
|
a.MountRouter(consts.URLPathSubsonicAPI, subsonic)
|
|
|
|
|
a.MountRouter(consts.URLPathUI, CreateAppRouter())
|
2020-01-24 01:29:31 -05:00
|
|
|
a.Run(":" + conf.Server.Port)
|
2016-02-23 18:41:35 -05:00
|
|
|
}
|