I have a Firebase Function and I need to retrieve an html file from a subfolder.
── functions
├── src
| ├── index.ts // The function is located here
| ├── html
| | ├── template.html // This is the file I want to access
I attempted to read the file using
const html = fs.readFileSync('./html/template.html');
but I keep getting the following error message
Error: ENOENT: no such file or directory, open './html/template.html' at Object.openSync
I have tried numerous solutions on stackoverflow without success. I even attempted moving the file into the same folder as the function, but encountered the same error.
Do I need to install a specific package or import the file in a different way to be able to access it?