There are several ways:
If you need some data in all routes, you could move data retrieval( and potentially some caching strategy) to express middleware and assign result to req object property
module.exports = function getArticles() { return function getArticlesRetrieval(req, res, next) { ArticleModel.find({}, function (err, articles){ if(err) return next(err); req.articles = articles; next(); }); }; };
More commonly you could improve code organization for complex logic using promises or async libraries. It allows you to have better maintainable code.