Separating keys for each development stage in Node #nodejs
//note: process environment variables will be set in heroku.
module.exports = {
googleClientID: process.env.GOOGLE_CLIENT_ID,
googleClientSecret: process.env.GOOGLE_CLIENT_SECRET,
mongoURI: process.env.MONGO_URI,
cookieKey: process.env.COOKIE_KEY
};
//note: don't commit this.
module.exports = {
googleClientID: '606040021319-alqi41lqjrd0rps3dm26dkhm48ej0rra.apps.googleusercontent.com',
googleClientSecret: '51DCh-JckUtq3lT0wYqJsR5Y',
mongoURI: 'mongodb://reciosonny:abcd@ds237868.mlab.com:37868/emaily-dev-sonnyr',
cookieKey: 'blablabla123' //random cookie
};
if (process.env.NODE_ENV === 'production') {
//we are in production
module.exports = require('./prod');
} else {
module.exports = require('./dev');
}