aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-09 14:05:21 +0100
committerChocobozzz <me@florianbigard.com>2021-12-09 14:09:24 +0100
commit650580504cf14a87bd4025eec9673eb5642dc71d (patch)
treeae5dce55a9cbe8c392db4668bb599c74a17b241d /server/controllers
parenta554bc1a260a525cd635d62404b9fe76fdb9e36b (diff)
downloadPeerTube-650580504cf14a87bd4025eec9673eb5642dc71d.tar.gz
PeerTube-650580504cf14a87bd4025eec9673eb5642dc71d.tar.zst
PeerTube-650580504cf14a87bd4025eec9673eb5642dc71d.zip
Add filter:api.server.stats.get.result hook
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/server/stats.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/api/server/stats.ts b/server/controllers/api/server/stats.ts
index d661144ca..2ab398f4d 100644
--- a/server/controllers/api/server/stats.ts
+++ b/server/controllers/api/server/stats.ts
@@ -3,6 +3,7 @@ import { StatsManager } from '@server/lib/stat-manager'
3import { ROUTE_CACHE_LIFETIME } from '../../../initializers/constants' 3import { ROUTE_CACHE_LIFETIME } from '../../../initializers/constants'
4import { asyncMiddleware } from '../../../middlewares' 4import { asyncMiddleware } from '../../../middlewares'
5import { cacheRoute } from '../../../middlewares/cache/cache' 5import { cacheRoute } from '../../../middlewares/cache/cache'
6import { Hooks } from '@server/lib/plugins/hooks'
6 7
7const statsRouter = express.Router() 8const statsRouter = express.Router()
8 9
@@ -12,7 +13,8 @@ statsRouter.get('/stats',
12) 13)
13 14
14async function getStats (_req: express.Request, res: express.Response) { 15async function getStats (_req: express.Request, res: express.Response) {
15 const data = await StatsManager.Instance.getStats() 16 let data = await StatsManager.Instance.getStats()
17 data = await Hooks.wrapObject(data, 'filter:api.server.stats.get.result')
16 18
17 return res.json(data) 19 return res.json(data)
18} 20}