aboutsummaryrefslogblamecommitdiffhomepage
path: root/shared/extra-utils/server/stats.ts
blob: b9dae24e26ebb50be0ef74f18702cde9378e24aa (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                     
                                                                                  
 
                                                   

                                     



                                                  


                         
          
                                             







                                                                              
import { makeGetRequest } from '../requests/requests'
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'

function getStats (url: string, useCache = false) {
  const path = '/api/v1/server/stats'

  const query = {
    t: useCache ? undefined : new Date().getTime()
  }

  return makeGetRequest({
    url,
    path,
    query,
    statusCodeExpected: HttpStatusCode.OK_200
  })
}

// ---------------------------------------------------------------------------

export {
  getStats
}