src/server/controllers.js
function getPayload(req, res, next) {
  req.hasCallback = false;
  req.payload = req.body.payload || [];

  // Determines if the request is asynchronous or not
  req.payload.forEach(function(arg, i) {
    if (arg === '__clientCallback__') {
      req.hasCallback = true;
      req.clientCallbackIndex = i;
    }
  });

  debug('Got payload' + (req.hasCallback ? ' with callback' : '') + ': ' +
    JSON.stringify(req.payload, null, 3));

  next();
}
function getPayload(req, res, next) {
  req.hasCallback = false;
  req.payload = req.body.payload || [];

  // Determines if the request is asynchronous or not
  req.payload.forEach(function(arg, i) {
    if (arg === '__clientCallback__') {
      req.hasCallback = true;
      req.clientCallbackIndex = i;
    }
  });

  debug('Got payload' + (req.hasCallback ? ' with callback' : '') + ': ' +
    JSON.stringify(req.payload, null, 3));

  next();
}
function getPayload ( req , res , next ) { req . hasCallback = false ; req . payload = req . body . payload || [ ] ; // Determines if the request is asynchronous or not req . payload . forEach ( function ( arg , i ) { if ( arg === '__clientCallback__' ) { req . hasCallback = true ; req . clientCallbackIndex = i ; } } ) ; debug ( 'Got payload' + ( req . hasCallback ? ' with callback' : '' ) + ': ' + JSON . stringify ( req . payload , null , 3 ) ) ; next ( ) ; }
Processes the client-side payload, and transforms the client-side
callback function signal to an actual callback function
Processes the client - side payload and transforms the client - side callback function signal to an actual callback function