1
0
mirror of https://framagit.org/framasoft/peertube/search-index/ synced 2025-01-10 16:42:36 +01:00
sepia-search-motore-di-rice.../server/lib/requests/instances-index.ts
2021-06-24 16:01:24 +02:00

20 lines
416 B
TypeScript

import { CONFIG } from '../../initializers/constants'
import { doRequest } from '../../helpers/requests'
async function listIndexInstancesHost (): Promise<string[]> {
const uri = CONFIG.INSTANCES_INDEX.URL
const qs = {
healthy: true,
count: 5000
}
const { body } = await doRequest<any>({ uri, qs, json: true })
return body.data.map(o => o.host as string)
}
export {
listIndexInstancesHost
}