Skip to content

Commit

Permalink
use redis from heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel authored and Nigel committed Jul 2, 2011
1 parent 7e7357d commit ef60f70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app2.coffee
@@ -1,12 +1,14 @@
express = require('express')
RedisStore = require('connect-redis')(express)
uri = URI.parse(ENV["REDISTOGO_URL"])
REDIS = {host: uri.host, port: uri.port, password: uri.password}

app = express.createServer()

# Setup configuration
app.use express.static(__dirname + '/public')
app.use express.cookieParser()
app.use express.session {secret: "Coffeebreak", store: new RedisStore, cookie: { maxAge: 60000 } }
app.use express.session {secret: "Coffeebreak", store: new RedisStore(REDIS), cookie: { maxAge: 60000 } }
app.set 'view engine', 'jade'

# App Routes
Expand Down
10 changes: 8 additions & 2 deletions app2.js
@@ -1,13 +1,19 @@
(function() {
var RedisStore, app, express;
var REDIS, RedisStore, app, express, uri;
express = require('express');
RedisStore = require('connect-redis')(express);
uri = URI.parse(ENV["REDISTOGO_URL"]);
REDIS = {
host: uri.host,
port: uri.port,
password: uri.password
};
app = express.createServer();
app.use(express.static(__dirname + '/public'));
app.use(express.cookieParser());
app.use(express.session({
secret: "Coffeebreak",
store: new RedisStore,
store: new RedisStore(REDIS),
cookie: {
maxAge: 60000
}
Expand Down

0 comments on commit ef60f70

Please sign in to comment.