code: func BuildRouterConfiguration(ctx context.Context, configuration *config.HTTPConfiguration, defaultRouterName string, defaultRuleTpl *template.Template, model interface{}) {
  	if len(configuration.Routers) == 0 {
  		if len(configuration.Services) > 1 {
  			log.FromContext(ctx).Info("Could not create a router for the container: too many services")
  		} else {
  			configuration.Routers = make(map[string]*config.Router)
  			configuration.Routers[defaultRouterName] = &config.Router{}
  		}
  	}
  
  	for routerName, router := range configuration.Routers {
  		loggerRouter := log.FromContext(ctx).WithField(log.RouterName, routerName)
  		if len(router.Rule) == 0 {
  			writer := &bytes.Buffer{}
  			if err := defaultRuleTpl.Execute(writer, model); err != nil {
  				loggerRouter.Errorf("Error while parsing default rule: %v", err)
  				delete(configuration.Routers, routerName)
  				continue
  			}
  
  			router.Rule = writer.String()
  			if len(router.Rule) == 0 {
  				loggerRouter.Error("Undefined rule")
  				delete(configuration.Routers, routerName)
  				continue
  			}
  		}
  
  		if len(router.Service) == 0 {
  			if len(configuration.Services) > 1 {
  				delete(configuration.Routers, routerName)
  				loggerRouter.
  					Error("Could not define the service name for the router: too many services")
  				continue
  			}
  
  			for serviceName := range configuration.Services {
  				router.Service = serviceName
  			}
  		}
  	}
  }
docs: // BuildRouterConfiguration Builds a router configuration.