function serveImagesInformation(req, res){
    cloudant.use(req.params.dronename + '_images').list({startkey:'1'}, function(err, response){
        if(err){
            logger.error(err);
            res.status(500).send("Internal error.");
        } else {
            
            for(var i=0; i< response.rows.length; i++) {
                delete response.rows[i].key;
                delete response.rows[i].value;
                if (response.rows[i].id.indexOf('_design') > -1) {
                    response.rows.splice(i, 1);
                }
            }
            res.status(200).send(response.rows);
        }
    });
}
/**
 * Serve Images list from Cloudant database
 * @param req {Object} The request from the client
 * @param res {Object} The response for the client
 */
Serve Images list from Cloudant database
@param req {Object} The request from the client
@param res {Object} The response for the client
Serve Images list from Cloudant database @param req { Object } The request from the client @param res { Object } The response for the client
function serveImagesInformation(req, res){
    cloudant.use(req.params.dronename + '_images').list({startkey:'1'}, function(err, response){
        if(err){
            logger.error(err);
            res.status(500).send("Internal error.");
        } else {
            for(var i=0; i< response.rows.length; i++) {
                delete response.rows[i].key;
                delete response.rows[i].value;
                if (response.rows[i].id.indexOf('_design') > -1) {
                    response.rows.splice(i, 1);
                }
            }
            res.status(200).send(response.rows);
        }
    });
}
function serveImagesInformation ( req , res ) { cloudant . use ( req . params . dronename + '_images' ) . list ( { startkey : '1' } , function ( err , response ) { if ( err ) { logger . error ( err ) ; res . status ( 500 ) . send ( "Internal error." ) ; } else { for ( var i = 0 ; i < response . rows . length ; i ++ ) { delete response . rows [ i ] . key ; delete response . rows [ i ] . value ; if ( response . rows [ i ] . id . indexOf ( '_design' ) > - 1 ) { response . rows . splice ( i , 1 ) ; } } res . status ( 200 ) . send ( response . rows ) ; } } ) ; }
Serve Images list from Cloudant database
 @param req {Object} The request from the client
 @param res {Object} The response for the client
Serve Images list from Cloudant database @param req { Object } The request from the client @param res { Object } The response for the client