Skip to content

Instantly share code, notes, and snippets.

Colton Baker Southern

  • NC, USA
Block or report user

Report or block Southern

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View connectRedis.js
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
REDIS_PARAMS.port = connection.port; = connection.hostname;
// connect to redis so we can put the express session there
var client = redis.createClient(REDIS_PARAMS.port,;
if ( connection.auth ) {
View gist:3642328
function findHandler(err, docs) {
if (!err) {
// Return Success & JSON Content-type
var length = docs.length;
// Process results from Mongo
docs.forEach(function(e,i,a) {
You can’t perform that action at this time.