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.
 
 

30 lines
624 B

const fs = require('fs');
const sql = require('../utils/sql');
module.exports=
{
/**
* Function which is responsible for writing the sitemap
* to ../sitemap.txt
*/
main: function()
{
sql.getSiteMap().then(function(result)
{
console.log(result);
fs.writeFile("./sitemap.txt", result, function(err)
{
if(err)
{
console.log(err);
}
else
{
console.log("sitemap updated");
}
});
});
}
}