Remove dependency of go-bindata (#818)

* Use new embed functionality for serving UI assets

* Use new embed functionality for serving resources. Remove dependency on go-bindata

* Remove Go 1.15
This commit is contained in:
Deluan Quintão 2021-03-12 11:06:51 -05:00 committed by GitHub
parent 5a259ef3ff
commit 2d528bbc87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 60 additions and 150 deletions

View file

@ -7,11 +7,11 @@ import (
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/cors"
"github.com/navidrome/navidrome/assets"
"github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/ui"
)
type Handler interface {
@ -59,7 +59,7 @@ func (a *Server) initRoutes() {
r.Use(middleware.Compress(5, "application/xml", "application/json", "application/javascript"))
r.Use(middleware.Heartbeat("/ping"))
r.Use(injectLogger)
r.Use(robotsTXT(assets.AssetFile()))
r.Use(robotsTXT(ui.Assets()))
indexHtml := path.Join(conf.Server.BaseURL, consts.URLPathUI, "index.html")
r.Get("/*", func(w http.ResponseWriter, r *http.Request) {