9260f92c4e8ac20a48f4482547a5e543bdc99c44
[motion2.git] / server / config / environment / index.js
1 'use strict';
2 /*eslint no-process-env:0*/
3 var path = require('path');
4 var _ = require('lodash');
5
6 /*function requiredProcessEnv(name) {
7   if(!process.env[name]) {
8     throw new Error('You must set the ' + name + ' environment variable');
9   }
10   return process.env[name];
11 }*/
12
13 // All configurations will extend these options
14 // ============================================
15 var all = {
16   env: process.env.NODE_ENV,
17
18   // Root path of server
19   root: path.normalize(__dirname + '/../../..'),
20
21   // Browser-sync port
22   browserSyncPort: process.env.BROWSER_SYNC_PORT || 3000,
23
24   port: process.env.PORT || 9000,
25
26   ip: process.env.IP || '127.0.0.1',
27
28   // Should we populate the DB with sample data?
29   seedDB: false,
30
31   // Secret for session, you will want to change this and make it an environment variable
32   secrets: {
33     session: 'xcally-motion-session-secret',
34     recording: 'xcally-motion-recording-secret'
35   },
36
37   encrypt: {
38     algorithm: 'aes192'
39   }
40 };
41
42 // Export the config object based on the NODE_ENV
43 // ==============================================
44 module.exports = _.merge(
45   all,
46   require('./shared'),
47   require('./' + (process.env.NODE_ENV || 'development') + '.js') || {});