Upload images with Cloudinary, MongoDB and Express.
Raphael Machado
Posted on July 13, 2022
We will have to create a middleware that uploads an image to cloudinary and returns it's image url
Create an account in cloudinary and choose programmable media.
Now go back to editor and create 3 variables in dotev file with these informations: CLOUD_NAME, API_KEY, API_SECRET.
You get that from cloudinary dashboard.
Create a folder 'utils' with a 'cloudinary.js' file.
Create a 'controller' folder with a 'cloudinaryMiddleware.js' file.
Now you just have to import and place it in your REST API like this:
💖 💪 🙅 🚩
Raphael Machado
Posted on July 13, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024