lbry-desktop/web/src/tempfile.js
2021-11-17 13:28:36 -05:00

13 lines
310 B
JavaScript

const fs = require('fs');
const path = require('path');
let tempFile;
async function getTempFile(ctx) {
const filename = ctx.params.filename;
if (!tempFile) {
tempFile = fs.readFileSync(path.join(__dirname, `/../dist/${filename}`), 'utf8');
}
return tempFile;
}
module.exports = { getTempFile };