From 5b4352c51e104d74a368dec50d5034b0d0a11bb4 Mon Sep 17 00:00:00 2001 From: Funey Date: Wed, 6 Jan 2021 14:31:59 +0000 Subject: [PATCH] add statistics docs, fix java statistics API endpoint --- docs/Statistics_API.MD | 48 ++++++++++++++++++++++++++++++++++++++++++ index.js | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 docs/Statistics_API.MD diff --git a/docs/Statistics_API.MD b/docs/Statistics_API.MD new file mode 100644 index 0000000..f9b5c1d --- /dev/null +++ b/docs/Statistics_API.MD @@ -0,0 +1,48 @@ +# Statistics API + +This is documentation for the Statistics API. + +## GET /statistics/api/skins + +### Parameters +**No parameters** + +### Returns +JSON string containing amount of skins cached, amount of skins overridden, epoch timestamp of previous skin cache wipe, epoch timestamp of next skin cache wipe. + +### Sample Resoponse +**MIME Type:** application/json + +```json +{"cached":0,"overridden":0,"cache_wipe_time":1610029624092,"previous_cache_wipe_time":1609943224092} +``` + +## GET /statistics/api/capes + +### Parameters +**No parameters** + +### Returns +JSON string containing amount of capes cached, amount of capes overridden, epoch timestamp of previous cape cache wipe, epoch timestamp of next cape cache wipe. + +### Sample Resoponse +**MIME Type:** application/json + +```json +{"cached":0,"overridden":0,"cache_wipe_time":1610116024092,"previous_cache_wipe_time":1609943224092} +``` + +## GET /statistics/api/java + +### Parameters +**No parameters** + +### Returns +JSON string containing versions of Java that have connected to this skins server (has count of each time). + +### Sample Response +**MIME Type:** application/json + +```json +{"Java/1.8.0_74":1} +``` \ No newline at end of file diff --git a/index.js b/index.js index c217ba8..060a876 100644 --- a/index.js +++ b/index.js @@ -490,7 +490,7 @@ app.get('/statistics/java', async (req,res) => { // Returns: // - Java versions that have "phoned home" on MC client startup. -app.get('/statisticss/api/java', async (req,res) => { +app.get('/statistics/api/java', async (req,res) => { var javajson; if (fs.existsSync(Java_JSON)) { javajson = require(Java_JSON)