I’m working on a project that I want to work on both glitch and a local environment. The issue I’m having is detecting the .data dir using fs, specifically this code.
let dir = "../.data";
!fs.existsSync(dir) && fs.mkdirSync(dir);
let filepath = dir + "/keystore.json";
fs.writeFileSync(filepath, data);
This runs in a subdirectory, like backend/utils.js, so that is why the “…/” is needed.
I have it working locally on my PC; however, on glitch this gives me an EACCES error.
Can anyone help?