Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

  1. const utils = require('../utils/utils.js');
  2. var Promise = require('promise');
  3. module.exports=
  4. {
  5. /** Method which renders the entire sidebar through calling
  6. * appropriate widget js files.
  7. *
  8. * @param res
  9. * @returns {*|Promise}
  10. */
  11. main: function(res)
  12. {
  13. return new Promise(function(resolve, reject)
  14. {
  15. res.write("<div class=\"col-md-4\">");
  16. utils.include(res,"sidebar/sidebar.html").then(function()
  17. {
  18. return require("../sidebar/recentPosts.js").main(res);
  19. }).then(function()
  20. {
  21. return require("../sidebar/categoriesSideBar.js")
  22. .main(res);
  23. }).then(function()
  24. {
  25. res.write("</div>");
  26. resolve();
  27. }).catch(function(err)
  28. {
  29. console.log("hit error");
  30. console.log(err);
  31. })
  32. })
  33. }
  34. };