Created
January 8, 2019 13:49
-
-
Save PradalCyril/4aebd9906edb15ca1fe0c755560db1e1 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(); | |
router.use(function (req, res, next) { | |
console.log('Time:', Date.now()); | |
next(); | |
}); | |
/* GET home page. */ | |
router.get('/', function (req, res, next) { | |
res.render('index', { title: 'Express' }); | |
}); | |
router.get('/superMiddleware', (req, res, next) => { | |
console.log("hello middleware") | |
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