fix Saldo when press refuse coins.

fix Risolvere problema del ritardo quando si fa il primo login...
This commit is contained in:
Paolo Arena
2022-09-16 17:38:49 +02:00
parent 9f34a6b916
commit 671a39e51c
11 changed files with 162 additions and 62 deletions

View File

@@ -48,7 +48,18 @@ if ((process.env.NODE_ENV === 'production') ||
};
var https = require('https');
} else {
var http = require('http');
if (process.env.HTTPS_LOCALHOST) {
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
var credentials = {
key: privateKey,
cert: certificate,
};
var https = require('https');
} else {
var http = require('http');
}
}
console.log('DB: ' + process.env.DATABASE);
@@ -220,7 +231,7 @@ myLoad().then(ris => {
}
if ((process.env.NODE_ENV === 'production') ||
(process.env.NODE_ENV === 'test')) {
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST) {
var httpsServer = https.createServer(credentials, app);
console.log('httpsServer: port ', port);
httpsServer.listen(port);