-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
84 lines (68 loc) · 2.62 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Distributed under MS-RSL license: see /LICENSE for terms. Copyright 2019-2021 Dominic Morris.
'use strict';
module.exports = {
WEBSITE_DOMAIN : 'scoop.tech',
WEBSITE_URL : `https://scoop.tech`,
GITHUB_URL : `https://github.com/Scoop-Tech/scpx-wallet`,
get: function (key) {
if (process.env[key] != null)
return process.env[key];
//console.log(`Failed to find config key ${key} in process.env; looking for config file...`);
var config_json = require('./config.json');
if (config_json[key] != null)
return config_json[key];
console.error(`### missing config!: ${key}`);
return null;
},
scp_sql_config: function() {
return { // https://www.npmjs.com/package/mssql#tedious
user: this.get('scp_sql_user'),
password: this.get('scp_sql_password'),
server: this.get('scp_sql_server'),
database: this.get('scp_sql_database'),
connectionTimeout: 3000,
requestTimeout: 3000,
pool: { // https://github.com/coopernurse/node-pool
max: 10,
min: 0,
idleTimeoutMillis: 30000,
},
options: {
encrypt: true // Use this if you're on Windows Azure
}
}
},
stm_sql_db: function () {
return {
name: this.get('stm_db_name'),
config: {
user: this.get('stm_sql_user'),
password: this.get('stm_sql_password'),
server: this.get('stm_sql_server'),
database: this.get('stm_sql_database'),
port: this.get('stm_sql_port'),
connectionTimeout: 3000,
requestTimeout: 3000,
pool: { max: 10, min: 0, idleTimeoutMillis: 30000, },
options: { encrypt: true }
}
};
},
// stm_sql_dbs: function () {
// const dbs = this.get('stm_dbs');
// return dbs.map(p => { return {
// name: p.stm_db_name,
// config: {
// user: p.stm_sql_user,
// password: p.stm_sql_password,
// server: p.stm_sql_server,
// database: p.stm_sql_database,
// port: p.stm_sql_port,
// connectionTimeout: 3000,
// requestTimeout: 3000,
// pool: { max: 10, min: 0, idleTimeoutMillis: 30000, },
// options: { encrypt: true }
// }
// }});
// },
};