Skip to content

Instantly share code, notes, and snippets.

View bahayman's full-sized avatar

Baruch Hayman bahayman

View GitHub Profile
@bahayman
bahayman / router.js
Last active September 21, 2016 15:21
Express router chaining
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);