Skip to content

Commit abfc6f5

Browse files
committed
Update readme
1 parent 99ac55d commit abfc6f5

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,34 @@
22

33
A Node.js wrapper for the Multicraft API.
44

5-
To view examples of use, check out the `examples.js` file.
65

7-
### Updating
6+
### Example use
7+
8+
`npm i multicraft-api-node`
9+
10+
```
11+
const MulticraftAPI = require('multicraft-api-node');
12+
13+
const api = new MulticraftAPI({
14+
url: "https://localhost/api.php",
15+
user: "username",
16+
key: "apiKey"
17+
});
18+
19+
api.listServersByConnection({ connection_id: '1' })
20+
.then((data) => console.log(data))
21+
.catch((err) => console.error(err));
22+
23+
// {
24+
// success: true,
25+
// errors: [],
26+
// data: { Servers: { '1': 'test', '2': 'Minecraft Server' } }
27+
// }
28+
29+
```
30+
To view more examples of use, check out the `examples.js` file.
31+
32+
### Manual Updating
833

934
The `methods.json` file automatically generates the functions. To update this file:
1035

0 commit comments

Comments
 (0)