NuxtN
Nuxt2y ago
ahsan

access public text files from server

On my vercel deployment i receive this error:
ENOENT: no such file or directory, open '/var/task/public/quran.txt'

however it works fine on my local env. What filepath do i use to access a text document from my server?

fs.readFileSync(path.join(process.cwd(), 'public', 'text.txt'), 'utf-8');
Was this page helpful?