forked from HospitalRun/hospitalrun-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-example.js
42 lines (38 loc) · 1.56 KB
/
config-example.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
var config = {
couchDbServer: 'localhost',
couchDbPort: '5984',
couchDbUseSsl: false,
couchDbChangesSince: 'now',
couchAdminUser: 'COUCH ADMIN USER GOES HERE',
couchAdminPassword: 'COUCH ADMIN PASSWORD GOES HERE',
googleClientId: 'FOR GOOGLE SSO; GOOGLE CLIENT ID GOES HERE',
googleClientSecret: 'FOR GOOGLE SSO; GOOGLE CLIENT SECRET GOES HERE',
serverPort: '3000',
server: 'localhost',
sslCert: 'file location of ssl cert if needed',
sslKey: 'file location of ssl key if needed',
sslCA: [], // Array of file locations of trusted certificates in PEM format if needed
useSSL: false,
imagesdir: __dirname + '/patientimages',
logRequests: false,
logFormat: 'default' // See http://www.senchalabs.org/connect/logger.html for log formats
};
config.couchCredentials = function() {
if (config.couchAdminUser && config.couchAdminPassword) {
return config.couchAdminUser + ':' + config.couchAdminPassword + '@';
} else {
return '';
}
};
config.getProtocol = function(isSSL) {
return 'http' + (isSSL ? 's' : '') + '://';
};
config.serverURL = config.getProtocol(config.useSSL) + config.server;
if (config.serverPort) {
config.serverURL += ':' + config.serverPort;
}
config.couchDbURL = config.getProtocol(config.couchDbUseSsl) + config.couchDbServer + ':' + config.couchDbPort;
config.couchAuthDbURL = config.getProtocol(config.couchDbUseSsl) + config.couchCredentials() + config.couchDbServer + ':' + config.couchDbPort;
config.searchURL = 'http://localhost:9200'; // ELASTIC SEARCH URL
config.webDir = __dirname + '/public';
module.exports = config;