diff --git a/package.json b/package.json index ce1983e..953532e 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "phantomjs-prebuilt": "^2.1.7", "selenium-standalone": "^5.9.0", "shelljs": "^0.7.6", - "standard": "latest", + "standard": "8.6.0", "supertest": "^2.0.0" }, "snyk": true diff --git a/run.js b/run.js index e3a0f8c..87ea220 100644 --- a/run.js +++ b/run.js @@ -31,12 +31,12 @@ process.on('unhandledRejection', function (reason) { }) process.on('uncaughtException', function (err) { - try{ - require('./server/db.js').disconnect(function(){ + try { + require('./server/db.js').disconnect(function () { console.log('Disconnected Database') }) - }catch(disconnectError){ - console.log('Error Trying to disconnect from the DB',disconnectError) + } catch (disconnectError) { + console.log('Error Trying to disconnect from the DB', disconnectError) } debug('System Error uncaughtException:' + err) console.error('[UNCAUGHT EXCEPTION] - ', err.message) diff --git a/server.mean.js b/server.mean.js index 34e682c..822cdc4 100644 --- a/server.mean.js +++ b/server.mean.js @@ -56,7 +56,7 @@ function Mean (opts, done) { }) }, https: function (cb) { - if(!self.settings.https.active) return cb() + if (!self.settings.https.active) return cb() https.createServer({ key: fs.readFileSync(self.settings.https.key), cert: fs.readFileSync(self.settings.https.cert) @@ -66,8 +66,8 @@ function Mean (opts, done) { cb() }) }, - redirect:function (cb) { - if (self.settings.http.active || !self.settings.https.redirect || !self.settings.https.active ) return cb() + redirect: function (cb) { + if (self.settings.http.active || !self.settings.https.redirect || !self.settings.https.active) return cb() var app = require('express')() app.set('forceSSLOptions', { httpsPort: self.settings.https.port @@ -76,12 +76,10 @@ function Mean (opts, done) { http.createServer(app).listen(self.settings.http.port, function () { self.logger.info('HTTP FORCE SSL Express server listening on port %d in %s mode', self.settings.http.port, self.environment) debug('HTTP FORCE SSL Express server listening on port %d in %s mode', self.settings.http.port, self.environment) - done() + cb() }) } - }, function(err, results) { - return done() - }) + }, done) } if (!module.parent) { diff --git a/server/db.js b/server/db.js index a3e63c2..58fe99a 100644 --- a/server/db.js +++ b/server/db.js @@ -32,6 +32,6 @@ function mongoDB (self) { }) } function disconnect (cb) { - if(!cb)cb = function(){} + if (!cb)cb = function () {} mongoose.disconnect(cb) -} \ No newline at end of file +}