Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Pass db connection object to connect-mongo.
Browse files Browse the repository at this point in the history
  • Loading branch information
pontifier committed Oct 9, 2013
1 parent 13f03ec commit 1005d3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var express = require('express'),
helpers = require('view-helpers'),
config = require('./config');

module.exports = function(app, passport) {
module.exports = function(app, passport, db) {
app.set('showStackError', true);

//Should be placed before express.static
Expand Down Expand Up @@ -46,7 +46,7 @@ module.exports = function(app, passport) {
app.use(express.session({
secret: 'MEAN',
store: new mongoStore({
url: config.db,
db: db.connection.db,
collection: 'sessions'
})
}));
Expand Down Expand Up @@ -87,4 +87,4 @@ module.exports = function(app, passport) {
});

});
};
};
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ require('./config/passport')(passport);
var app = express();

//express settings
require('./config/express')(app, passport);
require('./config/express')(app, passport, db);

//Bootstrap routes
require('./config/routes')(app, passport, auth);
Expand All @@ -58,4 +58,4 @@ console.log('Express app started on port ' + port);
logger.init(app, passport, mongoose);

//expose app
exports = module.exports = app;
exports = module.exports = app;

0 comments on commit 1005d3b

Please sign in to comment.