root path hash redirect

default and hash paths are passed to frontend script that looks for a hash and redirects appropriately
This commit is contained in:
Joe Fleming 2015-08-12 18:06:09 -07:00
parent 2dd6036099
commit eb9080063b
3 changed files with 14 additions and 3 deletions

View file

@ -85,7 +85,10 @@ module.exports = function (kbnServer, server, config) {
path: '/',
method: 'GET',
handler: function (req, reply) {
reply.redirect(getDefaultRoute(kbnServer));
return reply.view('rootRedirect', {
hashRoute: '/app/kibana',
defaultRoute: getDefaultRoute(kbnServer),
});
}
});

View file

@ -16,7 +16,6 @@ module.exports = async function (kbnServer, server, config) {
}
}
let path = [];
let initialize = async id => {
let plugin = enabledPlugins[id];
@ -27,7 +26,6 @@ module.exports = async function (kbnServer, server, config) {
path.push(id);
for (let reqId of plugin.requiredIds) {
if (!enabledPlugins[reqId]) {
if (plugins.byId[reqId]) {

View file

@ -0,0 +1,10 @@
script.
var hashRoute = '#{hashRoute}';
var defaultRoute = '#{defaultRoute}';
var hash = window.location.hash;
if (hash.length) {
window.location = hashRoute + hash;
} else {
window.location = defaultRoute;
}