connect-server-status
Advanced tools
Comparing version 1.0.0 to 2.0.0
29
index.js
@@ -27,18 +27,15 @@ 'use strict'; | ||
function getConnections(server) { | ||
var defer = Promise.defer(); | ||
return new Promise(function (resolve, reject) { | ||
function done(concurrentConnections) { | ||
var r = {}; | ||
r[server instanceof http.Server ? 'http' : 'https'] = concurrentConnections; | ||
defer.resolve(r); | ||
} | ||
server.getConnections(function (err, concurrentConnections) { | ||
if (err) { | ||
return reject(new Error('Unable to fetch connection status for server: ' + err.message)); | ||
} | ||
server.getConnections(function (err, concurrentConnections) { | ||
if (err) { | ||
defer.reject(new Error('Unable to fetch connection status for server: ' + err.message)); | ||
} | ||
done(concurrentConnections); | ||
var r = {}; | ||
r[server instanceof http.Server ? 'http' : 'https'] = concurrentConnections; | ||
resolve(r); | ||
}); | ||
}); | ||
return defer.promise; | ||
} | ||
@@ -94,3 +91,3 @@ | ||
status(servers, opts.add || {}).then(function (status) { | ||
res.send(status); | ||
res.json(status); | ||
}).catch(function (err) { | ||
@@ -104,3 +101,3 @@ next(err); | ||
if (exists) { | ||
return res.send(503); | ||
return res.sendStatus(503); | ||
} | ||
@@ -113,2 +110,2 @@ sendStatus(); | ||
}; | ||
}; | ||
}; |
{ | ||
"name": "connect-server-status", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Server status middleware", | ||
@@ -33,12 +33,12 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird": "^2.1.3" | ||
"bluebird": "^3.3.5" | ||
}, | ||
"devDependencies": { | ||
"express": "~3.4.7", | ||
"jshint": "~2.4.1", | ||
"mocha": "~1.17.0", | ||
"release-it": "0.0.9", | ||
"should": "~2.1.1", | ||
"supertest": "~0.8.3" | ||
"express": "~4.13.4", | ||
"jshint": "~2.9.1", | ||
"mocha": "~2.4.5", | ||
"release-it": "2.3.1", | ||
"should": "~8.3.0", | ||
"supertest": "~1.2.0" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8543
8
189
+ Addedbluebird@3.7.2(transitive)
- Removedbluebird@2.11.0(transitive)
Updatedbluebird@^3.3.5