Solved
Reading a file in Adobe IO runtime project
Hello Team,
I am writing Nodejs actions, utility for Adobe IO runtime project.
Here, I have kept the mail templates under config folder. My logic has to read the config folder based on input condition.
While searcing, I got below details to read the file
const templateLoader = new TemplateLoader(path.join(__dirname, '../mail-templates'));
// Check if country template exists
if (fs.existsSync(countryPath)) {
return fs.readFileSync(countryPath, 'utf-8');
}
Also, I need to write below mentioned script in package.json file
Hello Team,
"scripts": {
"build": "cp -R src/actions/mail-templates dist/mail-templates"
}
Note: cp is a unix command. Was, not able to test in my local windows machine.
Was facing issues. Then, again I got solution that to use Nodejs specific commands.
So, I am bit sceptical about reading the file in serverless microservices. (In my case, Adobe IO runtime)
Can someone guide me on "Best way to read the file in Adobe IO runtime project?
Thanks in advance