let fs = require("fs"); let path = require("path"); const staticDir = path.join(__dirname, "static"); module.exports = (app) => { function renderAndSave(file, template, options) { file = path.join(staticDir, file); app.render(template, options, (e, r) => { if (e) return fs.writeFile(file, "Something went wrong!

Something went wrong!

Could not render this page! Please contact the administrator!

"); return fs.writeFile(file, r); }); } if (!fs.existsSync(staticDir)) fs.mkdirSync(staticDir); [ ["index.htm", "linkList", { links: [ {href: "/ssh", name: "All SSH Keys"}, ] }], ].forEach(e => renderAndSave(e[0], e[1], e[2])); };