]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/utils/server/stats.ts
Move utils to /shared
[github/Chocobozzz/PeerTube.git] / shared / utils / server / stats.ts
1 import { makeGetRequest } from '../'
2
3 function getStats (url: string, useCache = false) {
4 const path = '/api/v1/server/stats'
5
6 const query = {
7 t: useCache ? undefined : new Date().getTime()
8 }
9
10 return makeGetRequest({
11 url,
12 path,
13 query,
14 statusCodeExpected: 200
15 })
16 }
17
18 // ---------------------------------------------------------------------------
19
20 export {
21 getStats
22 }