Skip to content

Instantly share code, notes, and snippets.

@newz2000

newz2000/app.js Secret

Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newz2000/962094cb267a532250f8 to your computer and use it in GitHub Desktop.
Save newz2000/962094cb267a532250f8 to your computer and use it in GitHub Desktop.
Enable session support
var session = require('express-session');
var MongoStore = require('connect-mongo')(session);
app.use(session({
secret: 'learn node',
resave: true,
saveUninitialized: false,
store: new MongoStore({url: MongoURI})
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment