sepia-search-motore-di-rice.../server/lib/requests/instances-index.ts

20 lines
416 B
TypeScript
Raw Normal View History

2021-06-24 15:18:54 +02:00
import { CONFIG } from '../../initializers/constants'
import { doRequest } from '../../helpers/requests'
2020-02-14 14:09:31 +01:00
2020-03-04 15:32:39 +01:00
async function listIndexInstancesHost (): Promise<string[]> {
2020-05-28 15:00:37 +02:00
const uri = CONFIG.INSTANCES_INDEX.URL
2020-02-14 14:09:31 +01:00
2020-05-28 15:00:37 +02:00
const qs = {
healthy: true,
count: 5000
}
2020-02-14 14:09:31 +01:00
2020-03-04 15:32:39 +01:00
const { body } = await doRequest<any>({ uri, qs, json: true })
2020-02-14 14:09:31 +01:00
return body.data.map(o => o.host as string)
}
export {
listIndexInstancesHost
}