Created
October 2, 2014 01:18
-
-
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
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
{ | |
"dependencies": { | |
"redis": "^0.10.1" | |
} | |
} |
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
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