const sql = require('../utils/sql'); module.exports= { /**Renders the popular posts sidebar. * * @param res * @returns {*|Promise} */ main: function(res) { return new Promise(function(resolve, reject) { res.write("
"); res.write("
" + "

Popular Posts

"); res.write("
"); sql.getPopularPosts().then(function(posts) { posts.forEach(function(cat) { console.log(cat); res.write("" + p.name + "
"); }); res.write("
"); resolve(); }); }); } };