mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-18 01:50:37 +01:00
moving out configuration items from express.js code to a proper configuration directive
This commit is contained in:
8
config/env/all.js
vendored
8
config/env/all.js
vendored
@@ -6,5 +6,11 @@ var rootPath = path.normalize(__dirname + '/../..');
|
||||
module.exports = {
|
||||
root: rootPath,
|
||||
port: process.env.PORT || 3000,
|
||||
db: process.env.MONGOHQ_URL
|
||||
db: process.env.MONGOHQ_URL,
|
||||
|
||||
// The secret should be set to a non-guessable string that
|
||||
// is used to compute a session hash
|
||||
sessionSecret: 'MEAN',
|
||||
// The name of the MongoDB collection to store sessions in
|
||||
sessionCollection: 'sessions'
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ module.exports = function(app, passport, db) {
|
||||
|
||||
// Express/Mongo session storage
|
||||
app.use(express.session({
|
||||
secret: 'MEAN',
|
||||
secret: config.sessionSecret,
|
||||
store: new mongoStore({
|
||||
db: db.connection.db,
|
||||
collection: 'sessions'
|
||||
collection: config.sessionCollection
|
||||
})
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user