index.js
function init (prefs, callback) {
	options = _.extend(defaults, prefs);
	app = options.app || express();
	app.use(cors());

	ramlMocker.generate(options, process(function(requestsToMock){
		requestsToMock.forEach(function(reqToMock){
			addRoute(reqToMock);
		});
		log(new Array(30).join('='));
		log('%s[%s]%s API routes generated', colors.qyan, requestsToMock.length, colors.default);

		if(typeof callback === 'function'){
			callback(app);
		}
	}));

	var watcher = watch();
	var server = launchServer(app);

	function close () {
		if (watcher) { watcher.close(); }
		if (server) { server.close(); }
	}

	return {
		close: close,
		server: server,
		watcher: watcher
	};
}
function init (prefs, callback) {
	options = _.extend(defaults, prefs);
	app = options.app || express();
	app.use(cors());

	ramlMocker.generate(options, process(function(requestsToMock){
		requestsToMock.forEach(function(reqToMock){
			addRoute(reqToMock);
		});
		log(new Array(30).join('='));
		log('%s[%s]%s API routes generated', colors.qyan, requestsToMock.length, colors.default);

		if(typeof callback === 'function'){
			callback(app);
		}
	}));

	var watcher = watch();
	var server = launchServer(app);

	function close () {
		if (watcher) { watcher.close(); }
		if (server) { server.close(); }
	}

	return {
		close: close,
		server: server,
		watcher: watcher
	};
}
function init ( prefs , callback ) { options = _ . extend ( defaults , prefs ) ; app = options . app || express ( ) ; app . use ( cors ( ) ) ; ramlMocker . generate ( options , process ( function ( requestsToMock ) { requestsToMock . forEach ( function ( reqToMock ) { addRoute ( reqToMock ) ; } ) ; log ( new Array ( 30 ) . join ( '=' ) ) ; log ( '%s[%s]%s API routes generated' , colors . qyan , requestsToMock . length , colors . default ) ; if ( typeof callback === 'function' ) { callback ( app ) ; } } ) ) ; var watcher = watch ( ) ; var server = launchServer ( app ) ; function close ( ) { if ( watcher ) { watcher . close ( ) ; } if ( server ) { server . close ( ) ; } } return { close : close , server : server , watcher : watcher } ; }
Initializing RAML mocker server
@param  {Function} cb    callback executed af
@param  {Object}   prefs configuration object
@return {[type]}         [description]
Initializing RAML mocker server