mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-30 14:31:42 -05:00
Add uncaught exception handler
This commit is contained in:
parent
b8c87c1b89
commit
c851d1d808
@ -11,12 +11,17 @@ const helmet = require('helmet');
|
|||||||
const app = express();
|
const app = express();
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
|
|
||||||
|
process.on('uncaughtException', function (err) {
|
||||||
|
console.log('FATAL UNCAUGHT EXCEPTION:');
|
||||||
|
console.log(err.stack);
|
||||||
|
});
|
||||||
|
|
||||||
// MongoDB
|
// MongoDB
|
||||||
const dbHost = config.get('Database.host');
|
const dbHost = config.get('Database.host');
|
||||||
let db;
|
let db;
|
||||||
mongoose.connect(dbHost, {useNewUrlParser: true})
|
mongoose.connect(dbHost, {useNewUrlParser: true})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('Connected to database ' + dbHost);
|
console.log('Connected to database ' + dbHost + '\n');
|
||||||
db = mongoose.connection;
|
db = mongoose.connection;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user