This content originally appeared on DEV Community and was authored by Raphael Machado
We will have to create a middleware that uploads a 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:
This content originally appeared on DEV Community and was authored by Raphael Machado
Raphael Machado | Sciencx (2022-07-13T15:04:55+00:00) Upload images with Cloudinary, MongoDB and Express.. Retrieved from https://www.scien.cx/2022/07/13/upload-images-with-cloudinary-mongodb-and-express/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.


