Created
January 4, 2017 05:22
-
-
Save nisargap/565e64318d97ccb2e888844ed5b21af0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nasty line to refactor: | |
// app.use(require('express-session')({ secret: 'keyboard cat', resave: false, saveUninitialized: false })); | |
// No one can read that | |
// expressSession library | |
var expressSession = require('express-session'); | |
// sessionOptions object | |
var sessionOptions = { | |
secret: "keyboard cat", | |
resave: false, | |
saveUninitialized: true | |
} | |
var sessionInstance = expressSession(sessionOptions); | |
// Use the session instance | |
app.use(sessionInstance); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment