diff --git a/src/server/config/schema.js b/src/server/config/schema.js index 319cc075be16c..7a0a489dcf34c 100644 --- a/src/server/config/schema.js +++ b/src/server/config/schema.js @@ -37,7 +37,7 @@ module.exports = () => Joi.object({ port: Joi.number().default(5601), maxPayloadBytes: Joi.number().default(1048576), autoListen: Joi.boolean().default(true), - defaultRoute: Joi.string(), + defaultRoute: Joi.string().default('/app/kibana').regex(/^\//, `start with a slash`), basePath: Joi.string().default('').allow('').regex(/(^$|^\/.*[^\/]$)/, `start with a slash, don't end with one`), ssl: Joi.object({ cert: Joi.string(), diff --git a/src/server/http/get_default_route.js b/src/server/http/get_default_route.js index bded590cbb168..09d525bbb006a 100644 --- a/src/server/http/get_default_route.js +++ b/src/server/http/get_default_route.js @@ -2,9 +2,5 @@ import _ from 'lodash'; module.exports = _.once(function (kbnServer) { const { uiExports, config } = kbnServer; - // user configured default route - let defaultConfig = config.get('server.defaultRoute'); - if (defaultConfig) return defaultConfig; - - return `${config.get('server.basePath')}/app/kibana`; + return `${config.get('server.basePath')}${config.get('server.defaultRoute')}`; });