in my backend I am using Multer to save images in my server. They are saved in my images folder:
With react, I try to recover these images. I have the URL of the image in my props (mediaURL is http://localhost:4200/images/1635506218497.png) and so I do a src={mediaURL} but it does not display the image to me, only the alt attribute.
So I try to hand write the absolute path to the image or the relative path, but I have an error: "Module not found: You attempted to import ../../../../ ../../back-end/images/1635506218497.png which falls outside of the project src / directory. Relative imports outside of src / are not supported. "
Same thing if I try to import the image via a module.
How do I display my image?
I don't know if it's related but when I type http: // localhost: 4200 / images / 1635506218497.png in my browser, I have a "Cannot GET /images/1635506218497.png" but my backend is running on port 4200.