code: func NewRouteAppenderAggregator(ctx context.Context, chainBuilder chainBuilder, conf static.Configuration, entryPointName string, currentConfiguration *safe.Safe) *RouteAppenderAggregator {
  	aggregator := &RouteAppenderAggregator{}
  
  	if conf.Providers != nil && conf.Providers.Rest != nil {
  		aggregator.AddAppender(conf.Providers.Rest)
  	}
  
  	if conf.API != nil && conf.API.EntryPoint == entryPointName {
  		chain := chainBuilder.BuildChain(ctx, conf.API.Middlewares)
  		aggregator.AddAppender(&WithMiddleware{
  			appender: api.Handler{
  				EntryPoint:            conf.API.EntryPoint,
  				Dashboard:             conf.API.Dashboard,
  				Statistics:            conf.API.Statistics,
  				DashboardAssets:       conf.API.DashboardAssets,
  				CurrentConfigurations: currentConfiguration,
  				Debug:                 conf.Global.Debug,
  			},
  			routerMiddlewares: chain,
  		})
  
  	}
  
  	if conf.Ping != nil && conf.Ping.EntryPoint == entryPointName {
  		chain := chainBuilder.BuildChain(ctx, conf.Ping.Middlewares)
  		aggregator.AddAppender(&WithMiddleware{
  			appender:          conf.Ping,
  			routerMiddlewares: chain,
  		})
  	}
  
  	if conf.Metrics != nil && conf.Metrics.Prometheus != nil && conf.Metrics.Prometheus.EntryPoint == entryPointName {
  		chain := chainBuilder.BuildChain(ctx, conf.Metrics.Prometheus.Middlewares)
  		aggregator.AddAppender(&WithMiddleware{
  			appender:          metrics.PrometheusHandler{},
  			routerMiddlewares: chain,
  		})
  	}
  
  	return aggregator
  }
docs: // NewRouteAppenderAggregator Creates a new RouteAppenderAggregator