Skip to content

Commit

Permalink
Linted all files and set standardjs
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenPioneer committed Aug 2, 2017
1 parent b6702b8 commit 8e6f99d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 5 additions & 7 deletions server.mean.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions server/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ function mongoDB (self) {
})
}
function disconnect (cb) {
if(!cb)cb = function(){}
if (!cb)cb = function () {}
mongoose.disconnect(cb)
}
}

0 comments on commit 8e6f99d

Please sign in to comment.