Files
LawinServer/structure/contentpages.js
2024-06-25 06:18:43 +02:00

71 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const Express = require("express");
const express = Express.Router();
const functions = require("./functions.js");
express.get("/content/api/pages/fortnite-game/spark-tracks", async (req, res) => {
const sparkTracks = require("./../responses/Athena/sparkTracks.json");
res.json(sparkTracks)
})
express.get("/content/api/pages/fortnite-game/radio-stations", async (req, res) => {
res.json({
"_title": "Radio Stations",
"radioStationList": {
"_type": "RadioStationList",
"stations": [
{
"resourceID": "QWGQAynCdixzoLIdJl",
"stationImage": "https://fortnite-public-service-prod11.ol.epicgames.com/images/lawinpfp.png",
"_type": "RadioStationItem",
"title": {
"ar": "الحفل الملكي",
"de": "Party Royale",
"en": "Party Royale",
"es": "Fiesta magistral",
"es-419": "Fiesta campal",
"fr": "Fête royale",
"it": "Party Reale",
"ja": "パーティーロイヤル",
"ko": "파티로얄",
"pl": "Królewska Impreza",
"pt-BR": "Festa Royale",
"ru": "Королевская вечеринка",
"tr": ılgın Parti",
"zh-CN": "空降派对",
"zh-Hant": "空降派對"
}
}
]
},
"_noIndex": false,
"_activeDate": "2024-06-13T10:00:00.000Z",
"lastModified": "2024-06-12T20:12:56.271Z",
"_locale": "en-US",
"_templateName": "FortniteGameRadioStations",
"_suggestedPrefetch": []
})
})
express.get("/content/api/pages/*", async (req, res) => {
const contentpages = functions.getContentPages(req);
res.json(contentpages)
})
express.post("/api/v1/fortnite-br/surfaces/*/target", async (req, res) => {
const motd = JSON.parse(JSON.stringify(require("./../responses/Athena/motd.json")));
const fields = ["title", "body", "TeaserTitle", "FullScreenTitle", "FullScreenBody"];
try {
motd.contentItems.forEach(item => {
fields.forEach(field => {
item.contentFields[field] = item.contentFields[field][req.body.language];
})
})
} catch (err) {}
res.json(motd)
})
module.exports = express;