Guest User

Untitled

a guest
Apr 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. let express = require('express')
  2. let router = express.Router()
  3.  
  4. /* GET home page. */
  5. router.get('/', function(req, res, next) {
  6. res.render('index', { title: 'Express' })
  7. })
  8.  
  9. /* superMiddleware page with a nice Middleware*/
  10.  
  11. router.use('/superMiddleware', function(req, res, next) {
  12. console.log('Hello middleware')
  13. next()
  14. }, function (req, res, next) {
  15. res.send('Hello World')
  16. })
  17.  
  18. module.exports = router
Add Comment
Please, Sign In to add comment