config.js
2.52 KB
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
/* ------------- [START SERVER CONFIG VARIABLES] ------------ */
var config = {
development: {
app_name: "CMF",
app_host: "0.0.0.0",
app_port: "3000",
app_https: false,
KEY: "key1.pem",
CERT: "cert1.pem",
service: {
PANDORA: {
// URI : 'http://25.27.7.151:34618', //JBOSS IOT
URI : 'http://25.27.7.151:34680', //JBOSS DEV
URI_EQX: "http://25.27.7.151:15300", //EQUINOX
//URI: "http://localhost:8080",
KEY: "./PANDORA_CERT/server.key",
CERT: "./PANDORA_CERT/server.pem",
PREFIX: "/phxPartner/v1/partner"
},
SPW:{
Name : "SPW API",
POST_SearchCustomer_URL : "http://10.1.3.74:8080",
POST_SearchCustomer_Timeout : 10
},
D01:{
Name : "CMF DB",
GET_Customer_URL : "http://localhost:8080",
GET_Customer_Timeout : 10,
POST_Customer_URL : "http://localhost:8080",
POST_Customer_Timeout : 10
}
},
log:{
logTime : 15,
statTime : 2,
detailTime : 15,
summaryTime : 15,
statInterval : 60,
appLogPath : './logTest/',
summaryPath : './logTest/',
statPath : './logTest/',
detailPath : './logTest/',
level : 'debug'
},
http_req_timeout: 120,
session: 30, //minutes
Default_Timeout: 10,
Uri_length: 1000
}
};
/* ------------- [END SERVER CONFIG VARIABLES] ------------ */
/* ------------- [START SERVER GET FUNTION] ------------ */
exports.get = function get(env) {
var cfg = config[env] || config.development;
cfg.app_host = process.env.APP_HOST || cfg.app_host;
cfg.app_port = process.env.APP_PORT || cfg.app_port;
cfg.app_https = process.env.USE_HTTPS || cfg.app_https;
cfg.db_ip_port = process.env.DATABASE_IP_PORT || cfg.db_ip_port;
cfg.pandora_key = process.env.PANDORA_KEY || cfg.pandora_key;
cfg.pandora_cert = process.env.PANDORA_CERT || cfg.pandora_cert;
cfg.KEY = process.env.KEY || cfg.KEY;
cfg.CERT = process.env.CERT || cfg.CERT;
cfg.tmp_path = process.env.TMP_PATH || cfg.tmp_path;
var envService = null;
try {
if (process.env.SERVICE && process.env.SERVICE.length > 0) {
envService = JSON.parse(process.env.SERVICE);
}
} catch (error) {
envService = null;
}
cfg.service = envService != null ? envService : cfg.service;
return cfg;
};
/* ------------- [END SERVER GET FUNTION] ------------ */