next.jsgraphqlrenderstrapicloudinary

Cannot find the URL to my Strapi Media Library


So, I hosted my strapi app on Cloudinary and Render. So there is a rich text input in my strapi backend. When i fetch the data using graphql, the images are sent out as URLs ofc. So when i host strapi in my localhost, the url is this, http://localhost:1337/uploads/Expressjs_706596c597.png. But when my app is hosted and is running, then also it is receiving http://localhost:1337/uploads/Expressjs_706596c597.png from the backend. Now that image does not exist as my localhost is not running. But when I try this this, renderURL/uploads/Expressjs_706596c597.png the image is still not there. So Where can I find the exact URL of my image?


Solution

  • When hosting your Strapi app on Cloudinary and Render, the URLs of the images served by Strapi will no longer be the local http://localhost:1337 URLs. Instead, you should be using the URLs provided by the Cloudinary integration. The URL provided by Cloudinary should have a format similar to https://res.cloudinary.com/<your-cloud-name>/image/upload/<version>/<your-image-file.jpg>.

    By using this Cloudinary URL, you can retrieve the image from anywhere, including your hosted app. Replace the http://localhost:1337 portion of the URL with the appropriate Cloudinary URL, and you should be able to access the image successfully.