Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] use config for default route, include basepath #6953

Merged
merged 1 commit into from
Apr 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')}`;
});