multicraft-api-node
v2.4.0
Published
API Version 2.4.0
Downloads
34
Readme
multicraft-api-node
A Node.js wrapper for the Multicraft API.
Example use
npm i multicraft-api-node
const MulticraftAPI = require('multicraft-api-node');
const api = new MulticraftAPI({
url: "https://localhost/api.php",
user: "username",
key: "apiKey"
});
api.listServersByConnection({ connection_id: '1' })
.then((data) => console.log(data))
.catch((err) => console.error(err));
// {
// success: true,
// errors: [],
// data: { Servers: { '1': 'test', '2': 'Minecraft Server' } }
// }
To view more examples of use, check out the examples.js
file.
Manual Updating
The methods.json
file automatically generates the functions. To update this file:
- Download the latest MulticraftAPI.php file (from the Multicraft panel files)
- Convert the array to a JSON object.
- Paste into the
methods.json
file (and test that it works).