Skip to content

Instantly share code, notes, and snippets.

@PradalCyril
Created January 8, 2019 13:49
Show Gist options
  • Save PradalCyril/4aebd9906edb15ca1fe0c755560db1e1 to your computer and use it in GitHub Desktop.
Save PradalCyril/4aebd9906edb15ca1fe0c755560db1e1 to your computer and use it in GitHub Desktop.
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