lib/middleware/app.js
function findMbaasApp(req, res, next){
  log.logger.debug("findMbaasApp for appname " + req.params.appname);
  getMbaasApp({
    '$or': [{name: req.params.appname}, {guid: req.params.appname}]
  }, function(err, appMbaas){
    if(err){
      log.logger.debug("findMbaasApp Error ", err);
      return next(err);
    }

    req.appMbaasModel = appMbaas;

    return next();
  });
}
function findMbaasApp(req, res, next){
  log.logger.debug("findMbaasApp for appname " + req.params.appname);
  getMbaasApp({
    '$or': [{name: req.params.appname}, {guid: req.params.appname}]
  }, function(err, appMbaas){
    if(err){
      log.logger.debug("findMbaasApp Error ", err);
      return next(err);
    }

    req.appMbaasModel = appMbaas;

    return next();
  });
}
function findMbaasApp ( req , res , next ) { log . logger . debug ( "findMbaasApp for appname " + req . params . appname ) ; getMbaasApp ( { '$or' : [ { name : req . params . appname } , { guid : req . params . appname } ] } , function ( err , appMbaas ) { if ( err ) { log . logger . debug ( "findMbaasApp Error " , err ) ; return next ( err ) ; } req . appMbaasModel = appMbaas ; return next ( ) ; } ) ; }
Middleware For Finding An App
@param req
@param res
@param next
Middleware For Finding An App