1e45884f53bb4f9a802d98bcb583340133079a3c
[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
38 // Export the config object based on the NODE_ENV
39 // ==============================================
40 module.exports = _.merge(
41     all,
42     require('./shared'),
43     require('./' + (process.env.NODE_ENV || 'development') + '.js') || {});