Skip to content

Commit

Permalink
[server] use config for default route, include basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Apr 16, 2016
1 parent 176d271 commit 5f283d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 1 addition & 5 deletions src/server/http/get_default_route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')}`;
});

0 comments on commit 5f283d7

Please sign in to comment.