1 import * as express from 'express'
2 import { StatsManager } from '@server/lib/stat-manager'
3 import { ROUTE_CACHE_LIFETIME } from '../../../initializers/constants'
4 import { asyncMiddleware } from '../../../middlewares'
5 import { cacheRoute } from '../../../middlewares/cache'
7 const statsRouter = express.Router()
9 statsRouter.get('/stats',
10 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.STATS)),
11 asyncMiddleware(getStats)
14 async function getStats (_req: express.Request, res: express.Response) {
15 const data = await StatsManager.Instance.getStats()
20 // ---------------------------------------------------------------------------