Skip to content

Instantly share code, notes, and snippets.

@Peregg
Created April 10, 2018 07:42
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 Peregg/cb630eb41438d52105c0fd6eaa520282 to your computer and use it in GitHub Desktop.
Save Peregg/cb630eb41438d52105c0fd6eaa520282 to your computer and use it in GitHub Desktop.
Node/session-quest
var express = require('express');
var router = express.Router();
/* définition de la VARIABLE à l'entrée de la session */
router.get('/session-in', function(req, res, next) {
req.session.song = 'be bop a lula';
res.end();
});
/* VARIABLE affichée au sortir de la session*/
router.get('/session-out', function(req, res, next) {
res.send(req.session.song);
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment