mirror of https://github.com/status-im/codimd.git
fix: returning 500 when getStatus failed
Signed-off-by: Raccoon <raccoon@hackmd.io>
This commit is contained in:
parent
a3742e4564
commit
ac6021a579
|
@ -4,14 +4,19 @@ const realtime = require('../realtime/realtime')
|
|||
const config = require('../config')
|
||||
|
||||
exports.getStatus = async (req, res) => {
|
||||
const data = await realtime.getStatus()
|
||||
|
||||
res.set({
|
||||
'Cache-Control': 'private', // only cache by client
|
||||
'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
|
||||
'Content-Type': 'application/json'
|
||||
})
|
||||
|
||||
try {
|
||||
const data = await realtime.getStatus()
|
||||
res.send(data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
res.status(500).send(e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
exports.getMetrics = async (req, res) => {
|
||||
|
|
Loading…
Reference in New Issue