Created
August 28, 2019 01:41
-
-
Save mattoni/07e76ff46e1a4aca421d08b04503abc6 to your computer and use it in GitHub Desktop.
List Servers With Stats Cycle API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Infrastructure } from "@cycleplatform/cycle-api"; | |
async function listServers() { | |
const resp = await Infrastructure.Servers.getCollection({ | |
token: | |
"secret_W8cSxydUl4xPI42bYxG2tx3FGgk81eJolblnZiA3N7ZCY4u7Qx4uI4eaVKkJ", | |
hubId: "5a14ddd8b6393d0001976f44", | |
query: { | |
meta: ["stats"] | |
}, | |
}); | |
if (!resp.ok) { | |
console.error(resp.error.title); | |
return; | |
} | |
console.log(JSON.stringify(resp.value, null, 2)); | |
} | |
listServers(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment