UNPKG

pterowrapperjs

Version:

A pterodactyl API wrapper which works for both client and admin side API's.

19 lines (17 loc) 528 B
import axios from 'axios'; import { pterodactyl } from '../client.js' async function getAllServers() { return new Promise(async (resolve, reject) => { axios.get(pterodactyl.url + '/api/client/', { headers: { 'Accept': 'application/json', 'Authorization': 'Bearer ' + pterodactyl.apiKey } }).then(data => { resolve(data) }).catch(err => { reject(err) }) }) } export default getAllServers;