Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Repository files navigation

JodexRestAPI

RestAPI plugin for bukkit/spigot/paper server
ko-fi

Server response

/api/server

{
  "serverOnline":"1",
  "playerList":"_Jodex__",
  "serverUptime":"1h 27s", 
  "worldTimeStatus":"Night",
  "serverTPS":"*20.0"
}

/api/player/NICKNAME

{
  "kills":"0",
  "timeDays":"0",
  "timeSeconds":"51",
  "balance":"0.0",
  "mobKills":"2",
  "success":true,
  "timeHours":"6",
  "deaths":"1",
  "timeMinutes":"43"
}

NodeJS examples

PlayerRequest (node-fetch)

  let url = `http://localhost:8080/api/player/NICKNAME`
  let response;
  try {
  response = await fetch(url, { method: "Get" });
  } catch (err) {
    return console.log('Response not found');
  }
  const json = await response.json();

PostRequest (node-fetch)

  let url = `http://localhost:8080/api/server/command`
  let response;
  const params = new URLSearchParams();
  params.append('command', "test command");
  try {
     response = await fetch(url, {method: 'POST', body: params});
    } catch (err) {
    return console.log('Response not found');
  }

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages