Closed Ethanpolley closed 4 years ago
@Ethanpolley You can still use the ImageField element without the entire URL.
<ImageField source="<Name_of_the_image_field>" src="url" />
For example,
<ImageField source="images" src="url" />
Is ImageField
element currently not working for you or do you have any specific need to utilize the full image URL?
Also, having the ID of the image, you could easily add the localhost:1337
to the beginning, which would then be the full image URL.
http://localhost:1337/uploads/0467e62f8dd94652928d9150f9b87476.png
The issue is that i am running my react app from port 3000 (so the link is localhost:3000), but I am running my strapi api from port 1337. Thus, when I load the image field, it tries to access the photos from localhost:3000/uploads/[file_id] instead of from the strapi api, localhost:1337/uploads/[file_id]
Do you have this "proxy": "http://localhost:1337"
in your package.json
of your react app?
That Worked! You are a miracle worker thank you so much!
No problem. Good luck!
How can i add proxy to production build? http-proxy-middleware doesnt work
By Default, when strapi is returning the url to an image it only returns beginning with the "/uploads/[id]". Is there anyway to get the entire url to return so that we can use the ImageField Elements in ReactAdmin?