Skip to content

Instantly share code, notes, and snippets.

@soner8
Created April 8, 2018 18:31
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 soner8/99b4a59714b82090cacb0bdc2d841215 to your computer and use it in GitHub Desktop.
Save soner8/99b4a59714b82090cacb0bdc2d841215 to your computer and use it in GitHub Desktop.
index.js
var express = require('express');
var router = express.Router();
var app = express();
/* GET home page. */
router.get('/', function (req, res) {
res.render('index', {
title: 'Express'
});
});
router.use('/superMiddleware', function (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