mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
24 lines
516 B
JavaScript
24 lines
516 B
JavaScript
|
const logger = require('@overleaf/logger')
|
||
|
const expressify = require('./expressify')
|
||
|
const { mongodb } = require('../../storage')
|
||
|
|
||
|
async function status(req, res) {
|
||
|
try {
|
||
|
await mongodb.db.command({ ping: 1 })
|
||
|
} catch (err) {
|
||
|
logger.warn({ err }, 'Lost connection with MongoDB')
|
||
|
res.status(500).send('Lost connection with MongoDB')
|
||
|
return
|
||
|
}
|
||
|
res.send('history-v1 is up')
|
||
|
}
|
||
|
|
||
|
function healthCheck(req, res) {
|
||
|
res.send('OK')
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
status: expressify(status),
|
||
|
healthCheck,
|
||
|
}
|