This file contains 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
REDIS_URL = process.env.REDIS_URL || 'redis://localhost:6379'; // global const for redis | |
var connection = require("url").parse(REDIS_URL); // parse redis url | |
REDIS_PARAMS = {}; // global const for redis connection settings, also used by socket.io | |
REDIS_PARAMS.port = connection.port; | |
REDIS_PARAMS.host = connection.hostname; | |
// connect to redis so we can put the express session there | |
var client = redis.createClient(REDIS_PARAMS.port, REDIS_PARAMS.host); | |
if ( connection.auth ) { |
This file contains 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
function findHandler(err, docs) { | |
if (!err) { | |
// Return Success & JSON Content-type | |
var length = docs.length; | |
writeMeta(self.res,200,url,length); | |
// Process results from Mongo | |
docs.forEach(function(e,i,a) { | |
//console.log(e,i,a); |