- Created Test Environment un Server test.freeplanet.app

- mongodb open 2 connections port (3000 and 3001) - 27017 and 27018
This commit is contained in:
Paolo Arena
2019-02-13 01:51:33 +01:00
parent ea06079878
commit df31a9ea9b
5 changed files with 19 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ const path = require('path');
i18n = require("i18n");
if (process.env.NODE_ENV === 'production') {
if ((process.env.NODE_ENV === 'production') || (process.env.NODE_ENV === 'test')) {
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 };
@@ -81,7 +81,6 @@ app.use('/users', users_router);
// next(err);
// });
// app.set('views', path.join(__dirname, 'views'));
// app.set('view engine', 'pug');
@@ -99,7 +98,7 @@ if (app.get('env') === 'development') {
});
}
if (process.env.NODE_ENV === 'production') {
if ((process.env.NODE_ENV === 'production') || (process.env.NODE_ENV === 'test')) {
var httpsServer = https.createServer(credentials, app);
console.log("httpsServer: port ", port);
httpsServer.listen(port);