N
Nuxt9mo 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'
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');
fs.readFileSync(path.join(process.cwd(), 'public', 'text.txt'), 'utf-8');
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server