Initial pass at redirecting / to a landing page

This commit is contained in:
G.Ambatte committed 2022-04-02 10:10:40 +13:00
1 parent 613b9c4405
commit 468ccd748d
2 files changed
+20

No files matched your search

+19
View File
@@ -109,9 +109,28 @@ app.get('/robots.txt', (req, res)=>{
//Home page
app.get('/', async (req, res, next)=>{
const homePageId = config.get('homePage');
if(homePageId){
return res.redirect('/home');
}
// const brew = homePageId ? await getBrewFromId(homePageId, 'share') : { text: welcomeText } ;
const brew = {
text : welcomeText
};
req.brew = brew;
return next();
});
app.get('/home', async (req, res, next)=>{
const homePageId = config.get('homePage');
const brew = homePageId ? await getBrewFromId(homePageId, 'share') : { text: welcomeText } ;
// const brew = {
// text : welcomeText
// };
req.brew = brew;
return next();
});