Besides we storing files on Cloudinary, we can use a powerful API to manipulate and transform images, apply effects, resize, and do a lot more things without using any software on our machine.
Let's go back to the books.js
controller to check what we used. We extracted the extra code inside the promises function to focus on the highlighted lines of code:
cloudinary.uploader.upload(imageFile, { tags: 'photobook', folder: req.body.category + '/', public_id: req.files.image.originalFilename // eager: { // width: 280, height: 200, crop: "fill", gravity: "face" // } }) .then(function (image) { ... }) .then(function (photo) { ... }) .finally(function () { ...