const { totalVideos } = await VideoModel.getStats()
const { totalLocalVideoComments } = await VideoCommentModel.getStats()
const { totalUsers, totalMonthlyActiveUsers, totalHalfYearActiveUsers } = await UserModel.getStats()
- let json = {}
if (req.params.version && (req.params.version === '2.0')) {
- json = {
+ const json = {
version: '2.0',
software: {
name: 'peertube',
}
} as HttpNodeinfoDiasporaSoftwareNsSchema20
res.contentType('application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.0#"')
- } else {
- json = { error: 'Nodeinfo schema version not handled' }
- res.status(HttpStatusCode.NOT_FOUND_404)
+ .send(json)
+ .end()
}
- return res.send(json).end()
+ return res.fail({
+ status: HttpStatusCode.NOT_FOUND_404,
+ message: 'Nodeinfo schema version not handled'
+ })
}
function getCup (req: express.Request, res: express.Response, next: express.NextFunction) {