[server] add baseUrl to /app/kibana redirects

This commit is contained in:
spalger 2015-11-06 15:58:32 -06:00
parent 1cfa5f632f
commit f7bc4da49a
2 changed files with 4 additions and 5 deletions

View file

@ -1,11 +1,10 @@
let _ = require('lodash');
module.exports = _.once(function (kbnServer) {
const { uiExports, config } = kbnServer;
// user configured default route
let defaultConfig = kbnServer.config.get('server.defaultRoute');
let defaultConfig = config.get('server.defaultRoute');
if (defaultConfig) return defaultConfig;
// redirect to the single app
let apps = kbnServer.uiExports.apps.toArray();
return '/app/kibana';
return `${config.get('basePath')}/app/kibana`;
});

View file

@ -99,7 +99,7 @@ module.exports = function (kbnServer, server, config) {
method: 'GET',
handler: function (req, reply) {
return reply.view('rootRedirect', {
hashRoute: '/app/kibana',
hashRoute: `${config.get('basePath')}/app/kibana`,
defaultRoute: getDefaultRoute(kbnServer),
});
}