How can i read the public directory in a meteor application inside my /server path.
I tried using the native \'fs\'
package but i keep getting a file/di
On the server you can use fs
to access any part of the meteor directory tree, not just /public
, for example
import fs from 'fs';
const rd = process.env.PWD;
const obj = JSON.parse(fs.readFileSync(`${rd}/private/file.json`));
would read and parse a json file located at private/file.json
under your meteor app directory root.