Skip to content

Instantly share code, notes, and snippets.

@maylisdoucet
Created April 9, 2018 15:17
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 maylisdoucet/8e063308f3e232d289bb206ca9e6e538 to your computer and use it in GitHub Desktop.
Save maylisdoucet/8e063308f3e232d289bb206ca9e6e538 to your computer and use it in GitHub Desktop.
var express = require('express');
var router = express.Router();
/* Récupération du paramètre d'URL + du level.
http://localhost:3000/superMiddleware
- contient deux fonctions,
- middleware comporte le next,
- middleware affiche hello middleware en console.
*/
router.get('/superMiddleware', (req, res, next) => {
console.log('Hello middleware');
next ();
}, function (req, res, next) {
res.send('Hello world');
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment