Minor Fixes: Added {useNewUrlParser} fix deprecated warning, suppress some console.log output
This commit is contained in:
parent
f809f8ecea
commit
63e1363dd2
@ -93,7 +93,7 @@ const mongoose = require('mongoose');
|
|||||||
mongoose.Promise = global.Promise;
|
mongoose.Promise = global.Promise;
|
||||||
|
|
||||||
// Connecting to the database
|
// Connecting to the database
|
||||||
mongoose.connect(dbConfig.url)
|
mongoose.connect(dbConfig.url, {useNewUrlParser: true})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Successfully connected to MongoDB.");
|
console.log("Successfully connected to MongoDB.");
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -236,6 +236,8 @@ try {
|
|||||||
ca = undefined;
|
ca = undefined;
|
||||||
console.log ("Note: Can't read CA bundle: "+e);
|
console.log ("Note: Can't read CA bundle: "+e);
|
||||||
}
|
}
|
||||||
|
if (ca != null) {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
key: fs.readFileSync ('keys/omkey.pem'),
|
key: fs.readFileSync ('keys/omkey.pem'),
|
||||||
cert: fs.readFileSync ('keys/certificate.pem'),
|
cert: fs.readFileSync ('keys/certificate.pem'),
|
||||||
@ -244,6 +246,7 @@ try {
|
|||||||
https.createServer (options, app) .listen (https_port, function () {
|
https.createServer (options, app) .listen (https_port, function () {
|
||||||
console.log ("Express https server listening on port " + https_port);
|
console.log ("Express https server listening on port " + https_port);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log ("Note: Can't read SSL keys/certs: "+e+"\nDisabling https server");
|
console.log ("Note: Can't read SSL keys/certs: "+e+"\nDisabling https server");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user