How to do it...

Let's go through the following steps to store our uploaded cover images in Cloudinary:

  1. First, we will need to configure Cloudinary by creating a new /middleware/cloudinary.js middleware:
We will load our private API credentials from Cloudinary. It is important to keep these a secret. I recommend that you use Node.js environment parameters to remain hidden from your source code.
var cloudinary = require('cloudinary');var JSONAPIError = require('jsonapi-serializer').Error;cloudinary.config({  cloud_name: process.env.cloudinaryCloudName,  api_key: process.env.cloudinaryAPIKey,  api_secret: process.env.cloudinaryAPISecret});var self = module.exports = {};
  1. Next, we will implement ...

Get MEAN Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.