This commit is contained in:
2025-12-15 14:06:33 +01:00
parent 554527445b
commit 97a322354f
8 changed files with 83 additions and 82 deletions

View File

@@ -330,7 +330,9 @@ func runServer(ctx context.Context) error {
// Initialize web UI
cfg := ccconf.GetPackageConfig("ui")
web.Init(cfg)
if err := web.Init(cfg); err != nil {
return fmt.Errorf("initializing web UI: %w", err)
}
// Initialize HTTP server
srv, err := NewServer(version, commit, date)

View File

@@ -50,7 +50,7 @@ const (
type Server struct {
router *mux.Router
server *http.Server
apiHandle *api.RestApi
apiHandle *api.RestAPI
}
func onFailureResponse(rw http.ResponseWriter, r *http.Request, err error) {
@@ -239,13 +239,13 @@ func (s *Server) init() error {
// Mount all /monitoring/... and /api/... routes.
routerConfig.SetupRoutes(secured, buildInfo)
s.apiHandle.MountApiRoutes(securedapi)
s.apiHandle.MountUserApiRoutes(userapi)
s.apiHandle.MountConfigApiRoutes(configapi)
s.apiHandle.MountFrontendApiRoutes(frontendapi)
s.apiHandle.MountAPIRoutes(securedapi)
s.apiHandle.MountUserAPIRoutes(userapi)
s.apiHandle.MountConfigAPIRoutes(configapi)
s.apiHandle.MountFrontendAPIRoutes(frontendapi)
if memorystore.InternalCCMSFlag {
s.apiHandle.MountMetricStoreApiRoutes(metricstoreapi)
s.apiHandle.MountMetricStoreAPIRoutes(metricstoreapi)
}
if config.Keys.EmbedStaticFiles {