3 var path = require('path');
4 var _ = require('lodash');
6 function requiredProcessEnv(name) {
7 if (!process.env[name]) {
8 throw new Error('You must set the ' + name + ' environment variable');
10 return process.env[name];
13 // All configurations will extend these options
14 // ============================================
16 env: process.env.NODE_ENV,
18 // Root path of server
19 root: path.normalize(__dirname + '/../../..'),
22 port: process.env.PORT || 9000,
25 ip: process.env.IP || '0.0.0.0',
27 // Should we populate the DB with sample data?
30 // Secret for session, you will want to change this and make it an environment variable
32 session: 'dashboard-secret'
36 userRoles: ['guest', 'user', 'admin'],
38 // MongoDB connection options
48 clientID: process.env.FACEBOOK_ID || 'id',
49 clientSecret: process.env.FACEBOOK_SECRET || 'secret',
50 callbackURL: (process.env.DOMAIN || '') + '/auth/facebook/callback'
54 clientID: process.env.TWITTER_ID || 'id',
55 clientSecret: process.env.TWITTER_SECRET || 'secret',
56 callbackURL: (process.env.DOMAIN || '') + '/auth/twitter/callback'
60 clientID: process.env.GOOGLE_ID || 'id',
61 clientSecret: process.env.GOOGLE_SECRET || 'secret',
62 callbackURL: (process.env.DOMAIN || '') + '/auth/google/callback'
66 // Export the config object based on the NODE_ENV
67 // ==============================================
68 module.exports = _.merge(
70 require('./' + process.env.NODE_ENV + '.js') || {});