const utils = require('../utils/utils.js');
var Promise = require('promise');
module.exports=
{
/** Method which renders the entire sidebar through calling
* appropriate widget js files.
*
* @param res
* @returns {*|Promise}
*/
main: function(res)
{
return new Promise(function(resolve, reject)
{
res.write("
");
utils.include(res,"sidebar/sidebar.html").then(function()
{
return require("../sidebar/recentPosts.js").main(res);
}).then(function()
{
return require("../sidebar/categoriesSideBar.js")
.main(res);
}).then(function()
{
res.write("
");
resolve();
}).catch(function(err)
{
console.log("hit error");
console.log(err);
})
})
}
};