-
-
Save mtermoul/80e8afc5fcc30ae6e0b58abb0f2df6d2 to your computer and use it in GitHub Desktop.
crowd-pitch/server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# server.js | |
app.get('/', async function(req, res) { | |
... | |
if (req.session.pageVariant === undefined) { | |
req.session.pageVariant = Math.floor(Math.random() * 2); | |
} | |
res.locals.pageB = (req.session.pageVariant === 1 ? true : false); | |
res.render('home'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment