add connection check endpoint (#6)
This commit is contained in:
parent
c529307d91
commit
a752c5a4c5
1 changed files with 8 additions and 0 deletions
|
@ -50,6 +50,14 @@ router.get('/file/*?', function(req, res, next) {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/is-mongoose-ok', function(req, res) {
|
||||
if (mongoose) {
|
||||
res.json({isMongooseOk: !!mongoose.connection.readyState})
|
||||
} else {
|
||||
res.json({isMongooseOk: false})
|
||||
}
|
||||
});
|
||||
|
||||
var Person = require('./myApp.js').PersonModel;
|
||||
|
||||
router.use(function(req, res, next) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue