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