Skip to content

Instantly share code, notes, and snippets.

@WaleedAshraf
Last active March 18, 2018 19:07
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 WaleedAshraf/b971376408fff07362a0e8e61216ea4b to your computer and use it in GitHub Desktop.
Save WaleedAshraf/b971376408fff07362a0e8e61216ea4b to your computer and use it in GitHub Desktop.
Mock Express Session
exports.submit = function(req, res) {
if (req.session.count && req.session.count > 0) { // get count from req.session
// perform further tasks
res.sendStatus(200);
} else {
res.sendStatus(400);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment