Discovery tab (unfinished)

This commit is contained in:
Lawin0129
2022-02-17 01:25:32 +00:00
parent 33a8d7ae17
commit 60f840f6c7
4 changed files with 469 additions and 0 deletions

24
structure/discovery.js Normal file
View File

@@ -0,0 +1,24 @@
const Express = require("express");
const express = Express.Router();
const discovery = require("./../responses/discovery_frontend.json");
express.post("/fortnite/api/game/v2/creative/discovery/surface/*", async (req, res) => {
switch (req.body.surfaceName) {
case "CreativeDiscoverySurface_Frontend":
if (req.body.panelName) {
for (var i in discovery.Panels) {
if (discovery.Panels[i].PanelName == req.body.panelName) {
res.json(discovery.Panels[i].Pages[req.body.pageIndex || 0])
}
}
} else {
res.json(discovery);
}
break;
default:
res.json({});
}
})
module.exports = express;