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

Commit

Permalink
moving out configuration items from express.js code to a proper confi…
Browse files Browse the repository at this point in the history
…guration directive
  • Loading branch information
lirantal committed Jan 5, 2014
1 parent e2ea8da commit ee63f17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion config/env/all.js
Expand Up @@ -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'
}
4 changes: 2 additions & 2 deletions config/express.js
Expand Up @@ -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
})
}));

Expand Down

0 comments on commit ee63f17

Please sign in to comment.