Skip to content

Instantly share code, notes, and snippets.

@atuttle
Created October 2, 2014 01:18
Show Gist options
  • Save atuttle/be777984b8f0a567fad8 to your computer and use it in GitHub Desktop.
Save atuttle/be777984b8f0a567fad8 to your computer and use it in GitHub Desktop.
Using a free RedisToGo Nano instance on heroku, or the default settings on your local environment
{
"dependencies": {
"redis": "^0.10.1"
}
}
var redis;
if (process.env.REDISTOGO_URL) {
var rtg = require("url").parse(process.env.REDISTOGO_URL);
redis = require("redis").createClient(rtg.port, rtg.hostname);
redis.auth(rtg.auth.split(":")[1]);
} else {
redis = require("redis").createClient();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment