Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/cryp. Cryptocurrency portfolio tracker (unfinished)
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930// native modulesconst fs = require("fs");
module.exports = (keyPath, certPath, callback) => {
function getCert() { fs.readFile(keyPath, (err, keyData) => { if (err) { console.log(`error reading TLS key (${keyPath}), retrying...`); } else { fs.readFile(certPath, (err, certData) => { if (err) { console.log(`error reading TLS cert (${certPath}), retrying...`); } else { success(); } }); } }); }
getCert(); const getCertInterval = setInterval(getCert, 2000); function success() { clearInterval(getCertInterval); callback(); }
}