@igea/oac_backend 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/package.json +1 -1
- package/src/config/development.json +1 -1
- package/src/config.js +8 -0
- package/src/index.js +1 -0
package/README.md
CHANGED
|
@@ -5,4 +5,25 @@ Backend service for the OAC project
|
|
|
5
5
|
### XSLT
|
|
6
6
|
```console
|
|
7
7
|
sudo apt install xsltproc
|
|
8
|
-
```
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## ENV variables
|
|
11
|
+
Env variables overwrites parameters from the config file
|
|
12
|
+
|
|
13
|
+
### OAC_DB_USER
|
|
14
|
+
Username for the OAC datbase
|
|
15
|
+
|
|
16
|
+
### OAC_DB_PASSWORD
|
|
17
|
+
Password for the OAC datbase
|
|
18
|
+
|
|
19
|
+
### OAC_SMTP_HOST
|
|
20
|
+
Host for the SMTP
|
|
21
|
+
|
|
22
|
+
### OAC_SMTP_PORT
|
|
23
|
+
Port for the SMTP
|
|
24
|
+
|
|
25
|
+
### OAC_SMTP_USER
|
|
26
|
+
Username for the SMTP
|
|
27
|
+
|
|
28
|
+
### OAC_SMTP_PASSWORD
|
|
29
|
+
Password for the SMTP
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -7,6 +7,14 @@ function loadConfig() {
|
|
|
7
7
|
const configFolder = process.env.OAC_CONFIG_FOLDER || __dirname;
|
|
8
8
|
const configPath = path.join(configFolder, 'config', `${env}.json`);
|
|
9
9
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
10
|
+
|
|
11
|
+
config.database.user = process.env.OAC_DB_USER || config.database.user;
|
|
12
|
+
config.database.password = process.env.OAC_DB_PASSWORD || config.database.password;
|
|
13
|
+
config.smtp.host = process.env.OAC_SMTP_HOST || config.smtp.host;
|
|
14
|
+
config.smtp.port = process.env.OAC_SMTP_PORT || config.smtp.port;
|
|
15
|
+
config.smtp.auth.user = process.env.OAC_SMTP_USER || config.smtp.auth.user;
|
|
16
|
+
config.smtp.auth.password = process.env.OAC_SMTP_PASSWORD || config.smtp.auth.password;
|
|
17
|
+
|
|
10
18
|
return config;
|
|
11
19
|
}
|
|
12
20
|
|
package/src/index.js
CHANGED