-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
43 lines (36 loc) · 1.32 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
/*
NFe2Ftp
Arquivo de configurações.
Thiago Bignotto
09/06/2018
*/
//container
var appConfig = {};
appConfig.testing = {
'envName' : 'testing',
'hashSecret' : 'nonono',
'originFolder' : 'C:\\xml\\nao_processado', //pasta onde os xmls são criados
'ftpFolder' : '', //pasta para enviar arquivos xmls
'time' : 1000 * 5, //tempo para verificar a pasta por novos xmls
'ftpServer' : 'localhost',
'ftpPort' : '21',
'ftpUser' : '',
'ftpPass' : ''
};
appConfig.production = {
'envName' : 'production',
'hashSecret' : 'nonono',
'originFolder' : 'C:\\xml\\nao_processado', //pasta onde os xmls são criados
'ftpFolder' : 'nao_processado', //pasta para enviar arquivos xmls
'time' : 1000 * 5, //tempo para verificar a pasta por novos xmls
'ftpServer' : 'robo.varitus.com.br',
'ftpPort' : 2121,
'ftpUser' : 'ftpbignotto',
'ftpPass' : ''
};
//determining wich config variables to export based on the environment variable
var chosenConfig = typeof(process.env.NODE_ENV) == 'string' ? process.env.NODE_ENV.toLowerCase() : '';
//check if there is a config variables for the chosen environment otherwise default testing environment
var configToExport = typeof(appConfig[chosenConfig]) == 'object' ? appConfig[chosenConfig] : appConfig.testing;
//export config
module.exports = configToExport;