Skip to content

Instantly share code, notes, and snippets.

@mattoni
Last active August 27, 2019 21:49
Show Gist options
  • Save mattoni/66fb8796a7f3e422f8f083e923d21746 to your computer and use it in GitHub Desktop.
Save mattoni/66fb8796a7f3e422f8f083e923d21746 to your computer and use it in GitHub Desktop.
List servers using Cycle API
import { Infrastructure } from "@cycleplatform/cycle-api";
async function listServers() {
const resp = await Infrastructure.Servers.getCollection({
token:
"secret_S8yL426IlEP2Xq1EzwG9VyBqqqXPfYwt4yA3xXCMRBY4QXO1110KDJIWbkviB",
hubId: "5a8a8f3df231a50001c2317c"
});
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