D
D
DeniSidorenko2020-11-09 10:41:09
Node.js
DeniSidorenko, 2020-11-09 10:41:09

MERN the path to the uploads folder?

Hello, I'm using the Mern stack. When adding a product, the photo is uploaded in the /uploads project root folder.
How to get the path to the image on the frontend side (react)? Tried writing localhost:5000/uploads(server on port 5000) but 404

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-11-09
@yarkov

You probably have some kind of directory with statics. Here put uploads inside that directory and upload there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question