Skip to content

Accessing files in the /public folder server side on vercel #44467

Answered by krisvegh
krisvegh asked this question in Help
Discussion options

You must be logged in to vote

If someone stumbles into this with the same issue, I've managed to access the files in the public folder from inside a serverless function using process.cwd() in the path:

const imgPath = path.join(process.cwd(), 'public', '90x50/pc_001jpg');

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@medovanx
Comment options

Answer selected by krisvegh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants