Change structure of LawinServer

This commit is contained in:
Lawin0129
2022-02-15 17:45:46 +00:00
parent acf6b1d3d6
commit 63cb770799
28 changed files with 7162 additions and 7102 deletions

22
structure/privacy.js Normal file
View File

@@ -0,0 +1,22 @@
const Express = require("express");
const express = Express.Router();
const fs = require("fs");
const privacy = require("./../responses/privacy.json");
express.get("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
privacy.accountId = req.params.accountId;
res.json(privacy);
})
express.post("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
privacy.accountId = req.params.accountId;
privacy.optOutOfPublicLeaderboards = req.body.optOutOfPublicLeaderboards;
fs.writeFileSync("./responses/privacy.json", JSON.stringify(privacy, null, 2));
res.json(privacy);
res.end();
})
module.exports = express;