Created
October 27, 2015 23:30
-
-
Save devalexandre/8089cd5b03882409aae3 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(); | |
// middleware specific to this router | |
router.use(function timeLog(req, res, next) { | |
console.log('Time: ', Date.now()); | |
next(); | |
}); | |
// define the home page route | |
router.get('/', function(req, res) { | |
res.send('Birds home page'); | |
}); | |
// define the about route | |
router.get('/about', function(req, res) { | |
res.send('About birds'); | |
}); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment