UNPKG

kibana-123

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

18 lines (13 loc) 463 B
import { defaultsDeep } from 'lodash'; import { ProxyConfig } from './proxy_config'; import { parse as parseUrl } from 'url'; export class ProxyConfigCollection { constructor(configs = []) { this.configs = configs.map(settings => new ProxyConfig(settings)); } configForUri(uri) { const parsedUri = parseUrl(uri); const settings = this.configs.map(config => config.getForParsedUri(parsedUri)); return defaultsDeep({}, ...settings); } }