Replace go-bindata with Go embed
Co-authored-by: nrwiersma <nick@wiersma.co.za>
This commit is contained in:
parent
7ff13c3e3e
commit
70359e5d27
27 changed files with 142 additions and 205 deletions
|
@ -3,7 +3,9 @@ package service
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/traefik/traefik/v2/pkg/api"
|
||||
"github.com/traefik/traefik/v2/pkg/api/dashboard"
|
||||
"github.com/traefik/traefik/v2/pkg/config/runtime"
|
||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
||||
"github.com/traefik/traefik/v2/pkg/metrics"
|
||||
|
@ -36,10 +38,17 @@ func NewManagerFactory(staticConfiguration static.Configuration, routinesPool *s
|
|||
}
|
||||
|
||||
if staticConfiguration.API != nil {
|
||||
factory.api = api.NewBuilder(staticConfiguration)
|
||||
apiRouterBuilder := api.NewBuilder(staticConfiguration)
|
||||
|
||||
if staticConfiguration.API.Dashboard {
|
||||
factory.dashboardHandler = api.DashboardHandler{Assets: staticConfiguration.API.DashboardAssets}
|
||||
factory.dashboardHandler = dashboard.Handler{}
|
||||
factory.api = func(configuration *runtime.Configuration) http.Handler {
|
||||
router := apiRouterBuilder(configuration).(*mux.Router)
|
||||
dashboard.Append(router, nil)
|
||||
return router
|
||||
}
|
||||
} else {
|
||||
factory.api = apiRouterBuilder
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue