src/routers/UIRecorder/UIRecorder.js
function start(callback) {
    var dbDeferred = Q.defer();
    config = defaultConfig;

    if (typeof gmeConfig.rest.components[CONFIG_ID] === 'object' &&
        gmeConfig.rest.components[CONFIG_ID].options) {

        config = gmeConfig.rest.components[CONFIG_ID].options;
    }

    mongodb.MongoClient.connect(config.mongo.uri, config.mongo.options, function (err, db) {
        if (err) {
            dbDeferred.reject(err);
        } else {
            dbConn = db;
            dbDeferred.resolve();
        }
    });

    return dbDeferred.promise.nodeify(callback);
}
function start(callback) {
    var dbDeferred = Q.defer();
    config = defaultConfig;

    if (typeof gmeConfig.rest.components[CONFIG_ID] === 'object' &&
        gmeConfig.rest.components[CONFIG_ID].options) {

        config = gmeConfig.rest.components[CONFIG_ID].options;
    }

    mongodb.MongoClient.connect(config.mongo.uri, config.mongo.options, function (err, db) {
        if (err) {
            dbDeferred.reject(err);
        } else {
            dbConn = db;
            dbDeferred.resolve();
        }
    });

    return dbDeferred.promise.nodeify(callback);
}
function start ( callback ) { var dbDeferred = Q . defer ( ) ; config = defaultConfig ; if ( typeof gmeConfig . rest . components [ CONFIG_ID ] === 'object' && gmeConfig . rest . components [ CONFIG_ID ] . options ) { config = gmeConfig . rest . components [ CONFIG_ID ] . options ; } mongodb . MongoClient . connect ( config . mongo . uri , config . mongo . options , function ( err , db ) { if ( err ) { dbDeferred . reject ( err ) ; } else { dbConn = db ; dbDeferred . resolve ( ) ; } } ) ; return dbDeferred . promise . nodeify ( callback ) ; }
Called before the server starts listening.
@param {function} callback
Called before the server starts listening .