Permalink
Browse files

Finalized on the session storage engine

  • Loading branch information...
1 parent 58e9e7e commit 90900b0bda5f3a12b3c4f14ba62dc6fbb5fe891a @mikevalstar committed Jan 28, 2012
Showing with 16 additions and 16 deletions.
  1. +15 −14 app.js
  2. +1 −2 package.json
View
29 app.js
@@ -2,25 +2,26 @@
* Module dependencies.
*/
var express = require('express')
- , mongoDb = require('mongodb').Db
- , mongoServer = require('mongodb').Server
- , mongoStore = require('connect-mongodb');
+ , mongoStore = require('session-mongoose');
var app = module.exports = express.createServer();
// Configuration
app.configure(function(){
- app.set('views', __dirname + '/views');
- app.set('view engine', 'jade');
- app.use(express.bodyParser());
- app.use(express.methodOverride());
- app.use(express.cookieParser());
-
- //server_config = new mongoServer('localhost', 27017, {auto_reconnect: true, native_parser: true});
- //new mongoDb('mv', server_config, {});
- app.use(express.session({ secret: "mv secret" }));
- app.use(app.router);
- app.use(express.static(__dirname + '/htdocs'));
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'jade');
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(express.cookieParser());
+
+ var mongooseSessionStore = new mongoStore({
+ url: "mongodb://localhost/mv",
+ interval: 120000
+ });
+
+ app.use(express.session( {cookie: {maxAge: 120000}, store: mongooseSessionStore, secret: "mv secret" }));
+ app.use(app.router);
+ app.use(express.static(__dirname + '/htdocs'));
});
// Error Handling
View
@@ -7,7 +7,6 @@
, "jade": ">= 0.0.1"
, "markdown-js": ">= 0.0.1"
, "mongoose": ">= 2.4.0"
- , "mongodb": "0.9.7"
- , "connect-mongodb": ">= 1.0"
+ , "session-mongoose": ">= 0.0.1"
}
}

0 comments on commit 90900b0

Please sign in to comment.