ahsan
ahsan
NNuxt
Created by ahsan on 4/20/2024 in #❓・help
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');
1 replies