-
Notifications
You must be signed in to change notification settings - Fork 0
/
program.js
62 lines (48 loc) · 1.5 KB
/
program.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env node
const { MinecraftService } = require('./dist');
const service = new MinecraftService();
// hardcode the correct id here when testing the various methods below
const id = 235784194;
// hardcode whatever command here when testing the command endpoint
// const command = 'sample command';
// phony id to use to test error handling of the various methods below
// const idOfDropletThatDoesNotExist = 2;
// const options = {
// name: 'minecraft-server',
// version: '1.16.1',
// size: 's-1vcpu-1gb',
// region: 'nyc3',
// flavor: 'vanilla'
// };
// service
// .createMinecraftDroplet(options)
// .then(droplet => {
// console.log(JSON.stringify(droplet));
// })
// .catch(err => {
// console.log(JSON.stringify(err));
// });
// service.stopMinecraftDroplet(id).catch(err => {
// console.log(err);
// });
// service.startMinecraftDroplet(id).catch(err => {
// console.log(err);
// });
service.killMinecraftDroplet(id).catch(err => {
console.log(JSON.stringify(err));
});
// service.startMinecraftRemotely(id).catch(err => {
// console.log(JSON.stringify(err));
// });
// service.stopMinecraftRemotely(id).catch(err => {
// console.log(JSON.stringify(err));
// });
// service.restartMinecraftRemotely(id).catch(err => {
// console.log(JSON.stringify(err));
// });
// service.getMinecraftServerStatus(id).catch(err => {
// console.log(JSON.stringify(err));
// });
// service.sendMinecraftCommand(id, command).catch(err => {
// console.log(JSON.stringify(err));
// });