public static IApplicationBuilder UseBackendSplicer(this IApplicationBuilder app, IConfigurationSection config)
        {
            var layoutRegistry = BuildLayoutRegistry(config);

            var backendRegistry = new BackendRegistry(GetBackends(config));

            return(app.UseMiddleware <BackendSplicerMiddleware>(layoutRegistry, backendRegistry));
        }
 public BackendSplicerMiddleware(
     RequestDelegate next,
     BackendRegistry backendRegistry,
     LayoutRegistry layoutRegistry,
     ProxyHttpClient proxyHttpClient = null)
 {
     _next            = next;
     _backendRegistry = backendRegistry;
     _layoutRegistry  = layoutRegistry;
     _proxyHttpClient = proxyHttpClient ?? new ProxyHttpClient();
 }