Created
April 9, 2018 15:17
-
-
Save maylisdoucet/8e063308f3e232d289bb206ca9e6e538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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