-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
57 lines (52 loc) · 1.6 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var
env = process.env.NODE_ENV || 'development',
config;
// Determines whether or not mock data is used in development
var USE_MOCK_REPOSITORY = true;
var USE_MOCK_REGISTRY = true;
var TWEET_IN_PRODUCTION = false;
config = {
production : {
db : {
URL : process.env['WAC_SERVICE_MONGODB_URL']
},
twitter : {
consumerKey : process.env['WAC_SERVICE_TWITTER_CONSUMER_KEY'],
consumerSecret : process.env['WAC_SERVICE_TWITTER_CONSUMER_SECRET'],
accessToken : process.env['WAC_SERVICE_TWITTER_ACCESS_TOKEN'],
accessTokenSecret : process.env['WAC_SERVICE_TWITTER_ACCESS_TOKEN_SECRET']
},
componentsURL : 'http://component.io/components/all',
componentInstallDir : __dirname + '/components',
tweet : TWEET_IN_PRODUCTION,
port : 9999
},
development : {
db : {
URL : 'mongodb://localhost:27017/wac-service'
},
componentsURL : USE_MOCK_REGISTRY ?
'http://localhost:8000/mock/registry' :
'http://component.io/components/all',
componentInstallDir : __dirname + '/components',
port : 8000,
useMockRegistry : USE_MOCK_REGISTRY,
useMockRepository : USE_MOCK_REPOSITORY
},
test : {
db : {
URL : 'mongodb://localhost:27017/wac-service-test'
},
componentsURL : 'http://localhost:8001/mock/registry',
componentInstallDir : __dirname + '/test/components',
port : 8001,
useMockRegistry : true,
useMockRepository : true
}
};
config = config[env];
// Helper environment methods
config.env = env;
config.isTest = env === 'test';
config.isDevelopment = env === 'development';
module.exports = config;