This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
for (var field in fields) { | |
if (typeof body[fields[field]] == 'undefined') { | |
callback({ | |
code: "FIELDS_MISSING", | |
field: fields[field] | |
}); | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sio = require('socket.io-client'); | |
var request = require('request'); | |
var async = require('async'); | |
var config = { ratio : 1000, | |
urlAbuela : 'http://localhost:3005/abuela', | |
urlCasa : 'http://localhost:3005/casa', | |
socketHost: 'localhost', | |
socketPort: '3004' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created with JetBrains WebStorm. | |
* User: mru | |
* Date: 24/10/12 | |
* Time: 09:12 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
var redisModule = require('redis'); | |
var rc = redisModule.createClient(6379, 'localhost'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created with JetBrains WebStorm. | |
* User: mru | |
* Date: 24/10/12 | |
* Time: 09:12 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
var redisModule = require('redis'); | |
var rc = redisModule.createClient(6379, 'localhost'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
var fs = require('fs'); | |
var initArr = []; | |
exports.init = function(directory, context, callback){ | |
var files = fs.readdirSync(directory); | |
console.log('Files Readed:' + files); | |
files.forEach(function(element) { | |
var module = require(directory + element); | |
initArr.push(function(cb) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
var fs = require('fs'); | |
var initArr = []; | |
var options = 'EmitterFoo'; | |
var files = fs.readdirSync("./listeners/"); //better sync | |
console.log('Files Readed:' + files); | |
files.forEach(function(element) { |