using server.expose instead of modifying core server (#17785) (#17787)

This commit is contained in:
Bill McConaghy 2018-04-18 19:12:32 -04:00 committed by GitHub
parent f6f5e691f0
commit c9c67d1b7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View file

@ -35,8 +35,6 @@ export function getSpec() {
return result;
}
export function consoleMixin(kbnServer, server) {
server.decorate('server', 'addExtensionSpecFilePath', (extensionSpecFilePath) => {
extensionSpecFilePaths.push(extensionSpecFilePath);
});
export function addExtensionSpecFilePath(extensionSpecFilePath) {
extensionSpecFilePaths.push(extensionSpecFilePath);
}

View file

@ -4,6 +4,7 @@ import { existsSync } from 'fs';
import { resolve, join, sep } from 'path';
import { has, isEmpty } from 'lodash';
import setHeaders from '../elasticsearch/lib/set_headers';
import { addExtensionSpecFilePath } from './api_server/spec';
import {
ProxyConfigCollection,
@ -78,6 +79,7 @@ export default function (kibana) {
},
init: function (server, options) {
server.expose('addExtensionSpecFilePath', addExtensionSpecFilePath);
if (options.ssl && options.ssl.verify) {
throw new Error('sense.ssl.verify is no longer supported.');
}

View file

@ -19,7 +19,6 @@ import { savedObjectsMixin } from './saved_objects';
import { kibanaIndexMappingsMixin } from './mappings';
import { serverExtensionsMixin } from './server_extensions';
import { uiMixin } from '../ui';
import { consoleMixin } from '../core_plugins/console/api_server/spec';
const rootDir = fromRoot('.');
@ -64,8 +63,6 @@ export default class KbnServer {
// setup saved object routes
savedObjectsMixin,
// setup extension point for console autocomplete endpoints
consoleMixin,
// ensure that all bundles are built, or that the
// watch bundle server is running
optimizeMixin,