var path = require('path'); const fs = require('fs'); export default function (Port) { console.log('Server listening on port ' + Port); var fsPath = path.resolve(__dirname) + '\\log.log'; fs.appendFileSync(fsPath, new Date() + ':' + ` process starts \r\n`);; var fsPath = path.resolve(__dirname) + '\\log.log'; process.on('uncaughtException', (err) => { console.log('uncaughtException'); console.dir({err}) fs.appendFileSync(fsPath, new Date()) + ':' + `Caught exception: ${err}\n`; process.exit(); }); process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at:', p, 'reason:', reason); }); }