Skip to content

Instantly share code, notes, and snippets.

@cormobro
Created January 10, 2019 14:22
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 cormobro/d084314386403f2da128f702e0419034 to your computer and use it in GitHub Desktop.
Save cormobro/d084314386403f2da128f702e0419034 to your computer and use it in GitHub Desktop.
index
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/superMiddleware', (req, res, next) => {
console.log("hello middleware");
return next(); // Permet de passer à la fonction suivante
}, (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