mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 11:17:19 +03:00
Show name of router in log
This commit is contained in:
parent
1d0e75151a
commit
86d3a219a9
@ -73,8 +73,8 @@ func runNavidrome() {
|
|||||||
func startServer() (func() error, func(err error)) {
|
func startServer() (func() error, func(err error)) {
|
||||||
return func() error {
|
return func() error {
|
||||||
a := CreateServer(conf.Server.MusicFolder)
|
a := CreateServer(conf.Server.MusicFolder)
|
||||||
a.MountRouter(consts.URLPathSubsonicAPI, CreateSubsonicAPIRouter())
|
a.MountRouter("WebUI", consts.URLPathUI, CreateAppRouter())
|
||||||
a.MountRouter(consts.URLPathUI, CreateAppRouter())
|
a.MountRouter("Subsonic API", consts.URLPathSubsonicAPI, CreateSubsonicAPIRouter())
|
||||||
return a.Run(fmt.Sprintf("%s:%d", conf.Server.Address, conf.Server.Port))
|
return a.Run(fmt.Sprintf("%s:%d", conf.Server.Address, conf.Server.Port))
|
||||||
}, func(err error) {
|
}, func(err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
@ -33,9 +34,9 @@ func New(ds model.DataStore) *Server {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Server) MountRouter(urlPath string, subRouter Handler) {
|
func (a *Server) MountRouter(description, urlPath string, subRouter Handler) {
|
||||||
urlPath = path.Join(conf.Server.BaseURL, urlPath)
|
urlPath = path.Join(conf.Server.BaseURL, urlPath)
|
||||||
log.Info("Mounting routes", "path", urlPath)
|
log.Info(fmt.Sprintf("Mounting %s routes", description), "path", urlPath)
|
||||||
subRouter.Setup(urlPath)
|
subRouter.Setup(urlPath)
|
||||||
a.router.Group(func(r chi.Router) {
|
a.router.Group(func(r chi.Router) {
|
||||||
r.Mount(urlPath, subRouter)
|
r.Mount(urlPath, subRouter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user