UNPKG

battlemetrics-client

Version:

TypeScript client library for the BattleMetrics API

20 lines 683 B
// src/resources/servers.ts import { getClient } from "../client"; import { buildQueryString } from "../utils/buildQueryString"; export async function getServerList(params) { const client = getClient(); if (params) { console.log(params); } const queryString = params ? buildQueryString(params) : ""; const url = queryString ? `/servers?${queryString}` : "/servers"; console.log("URL: ", url); const res = await client.get(url); return res.data; } export async function getServerInfo(serverId) { const client = getClient(); const res = await client.get(`/servers/${serverId}`); return res.data; } //# sourceMappingURL=servers.js.map