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.

31 lines
625 B

  1. const fs = require('fs');
  2. const sql = require('../utils/sql');
  3. module.exports=
  4. {
  5. /**
  6. * Function which is responsible for writing the sitemap
  7. * to ../sitemap.txt
  8. */
  9. main: function()
  10. {
  11. sql.getSiteMap().then(function(result)
  12. {
  13. console.log(result);
  14. fs.writeFile("./sitemap.txt", result, function(err)
  15. {
  16. if(err)
  17. {
  18. console.log(err);
  19. }
  20. else
  21. {
  22. console.log("sitemap updated");
  23. }
  24. });
  25. });
  26. }
  27. }