Skip to content

Instantly share code, notes, and snippets.

@mtermoul
Created May 17, 2019 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtermoul/80e8afc5fcc30ae6e0b58abb0f2df6d2 to your computer and use it in GitHub Desktop.
Save mtermoul/80e8afc5fcc30ae6e0b58abb0f2df6d2 to your computer and use it in GitHub Desktop.
crowd-pitch/server.js
# 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