Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.configure(function(){
- app.set('db-uri','mongodb://xxxx:xxxx@dbh00.mongolab.com:27007/testing');
- // ...
- });
- db = mongoose.connect(app.set('db-uri'));
- var mongo_connection_details = { dbname: db.db.databaseName,
- host: db.db.serverConfig.host,
- port: db.db.serverConfig.port,
- username: db.uri.username,
- password: db.uri.password,
- collection: "sessions"};
- // mongo session store
- app.use(express.session({store: mongoStore(mongo_connection_details)}));
- // using all the latest version of connect-mongodb, express and mongodb driver and mongoose.
- // works very well locally, but using mongolab or mongohq it hangs when it tries to write the session
Add Comment
Please, Sign In to add comment