Open jfromaniello opened 11 years ago
An example could be:
app.get('something', function (req, res) { res.render('view1'); }); app.get('other', function (req, res) { res.render('view1'); });
Refactor to:
function respondWithView (viewName) { return function ( req, res ) { res.render(viewName); }; } app.get('something', respondWithView('view1')); app.get('other', respondWithView('view2'));
An example could be:
Refactor to: