Last active
September 21, 2016 15:21
-
-
Save bahayman/f4402234e7c2955c02a089eb81c4c668 to your computer and use it in GitHub Desktop.
Express router chaining
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 dealsRouter = express.Router(); | |
dealsRouter.get('/', function (req, res) { | |
res.send("/deals/" + req.params.id); | |
}); | |
dealsRouter.get('/:id', function (req, res) { | |
res.send("/deals/" + req.params.id); | |
}); | |
app.use('/deals', dealsRouter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment