mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-26 00:52:48 +00:00
Initial pass at redirecting / to a landing page
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user