function initializeServer(server, backends) {
	var usedPorts = [];
	const listenPort = function (server, name, port) {
		server.listen(port, function () {
			console.log("JSON Server is running mock backend " + name + " in port " + port);
		});
	};

	Object.keys(backends).forEach(function (key) {
		var backend = backends[key];
		if (backend.mock === "json-server") {
			var port = backend.url.split(":").slice(-1)[0];
			if (usedPorts.indexOf(port) < 0) {
				usedPorts.push(port);
				listenPort(server, backend.name, port);
			}
		}
	});
}
/**
 * Start the server (listen to the different ports defined for every backend)
 * @param server
 * @param backends
 */
Start the server (listen to the different ports defined for every backend)
@param server
@param backends
Start the server ( listen to the different ports defined for every backend ) @param server @param backends
function initializeServer(server, backends) {
	var usedPorts = [];
	const listenPort = function (server, name, port) {
		server.listen(port, function () {
			console.log("JSON Server is running mock backend " + name + " in port " + port);
		});
	};
	Object.keys(backends).forEach(function (key) {
		var backend = backends[key];
		if (backend.mock === "json-server") {
			var port = backend.url.split(":").slice(-1)[0];
			if (usedPorts.indexOf(port) < 0) {
				usedPorts.push(port);
				listenPort(server, backend.name, port);
			}
		}
	});
}
function initializeServer ( server , backends ) { var usedPorts = [ ] ; const listenPort = function ( server , name , port ) { server . listen ( port , function ( ) { console . log ( "JSON Server is running mock backend " + name + " in port " + port ) ; } ) ; } ; Object . keys ( backends ) . forEach ( function ( key ) { var backend = backends [ key ] ; if ( backend . mock === "json-server" ) { var port = backend . url . split ( ":" ) . slice ( - 1 ) [ 0 ] ; if ( usedPorts . indexOf ( port ) < 0 ) { usedPorts . push ( port ) ; listenPort ( server , backend . name , port ) ; } } } ) ; }
Start the server (listen to the different ports defined for every backend)
 @param server
 @param backends
Start the server ( listen to the different ports defined for every backend ) @param server @param backends