redirect home to following page until we have an actual home page

This commit is contained in:
Sean Yesmunt 2020-01-02 11:36:21 -05:00
parent a8711c027f
commit ee2fce1bdf

View file

@ -13,6 +13,11 @@ async function redirectMiddleware(ctx, next) {
return;
}
if (path === '/') {
ctx.redirect(`/$/${PAGES.CHANNELS_FOLLOWING}`);
return;
}
if (!path.startsWith('/$/') && path.match(/^([^@/:]+)\/([^:/]+)$/)) {
ctx.redirect(url.replace(/^([^@/:]+)\/([^:/]+)(:(\/.*))/, '$1:$2')); // test against path, but use ctx.url to retain parameters
return;