function getClusterNodes (req, res, next) {
  if (res.locals.connection) {
    // only one server requested
    clusterNodes(res.locals.connection, function(err, nodeInfo) {
      if (err) {
        console.error(`Error checking cluster info for a connection: ${res.locals.connectionId} - ${JSON.stringify(err)}`);
        return res.json({error: "error reading cluster node info from server"});
      }
      else {
        return res.json({data: nodeInfo});
      }
    });
  } else {
    return next("No redis connections");
  }
}
middleware to fetch the result of the redis command "cluster nodes" returned as an object

@param req Express request object
@param res Express response object
@param next Express next middleware function