From ad765b725fc3ae2c348751712ab0a78ca805d78d Mon Sep 17 00:00:00 2001 From: ibratabian17 Date: Tue, 22 Oct 2024 17:55:26 +0700 Subject: [PATCH] Add url tester --- core/page/about.html | 88 +++++++++++++++++++++++++ core/page/test-request.html | 128 ++++++++++++++++++++++++++++++++++++ core/route/rdefault.js | 58 +++++++++------- package.json | 2 +- 4 files changed, 253 insertions(+), 23 deletions(-) create mode 100644 core/page/about.html create mode 100644 core/page/test-request.html diff --git a/core/page/about.html b/core/page/about.html new file mode 100644 index 0000000..7df4f44 --- /dev/null +++ b/core/page/about.html @@ -0,0 +1,88 @@ + + + + + + OpenParty + + + + +
+

OpenParty

+
+ +
+

About

+

OpenParty is a community-driven project developed by PartyTeam and LunarTeam as an alternative server solution for Just Dance Unlimited enthusiasts. This server allows you to enjoy the Just Dance Unlimited experience independently of official servers, which are no longer available.

+ +

This initiative aims to fill the void left by the discontinued official service, offering a reliable and enhanced alternative. OpenParty is crafted entirely from scratch, ensuring transparency and user trust. It strives to provide a seamless experience comparable to or even better than existing solutions like JDParty.

+ +

Keep this project alive

+ Support on Patreon +
+ + + + + diff --git a/core/page/test-request.html b/core/page/test-request.html new file mode 100644 index 0000000..6369c38 --- /dev/null +++ b/core/page/test-request.html @@ -0,0 +1,128 @@ + + + + + + URL Test System + + + +
+

URL Test System

+ + + + + + + + + + + + + + + +

Output:

+
Waiting for response...
+
+ + + + diff --git a/core/route/rdefault.js b/core/route/rdefault.js index b267529..0b75830 100644 --- a/core/route/rdefault.js +++ b/core/route/rdefault.js @@ -3,6 +3,7 @@ console.log(`[DEFROUTE] Initializing....`) var requestCountry = require("request-country"); const settings = require('../../settings.json'); var md5 = require('md5'); +const fs = require('fs'); const core = { main: require('../var').main, generatePlaylist: require('../lib/playlist').generatePlaylist, @@ -105,7 +106,7 @@ const resetTimeout = (ip, platform) => { exports.initroute = (app, express, server) => { app.get("/songdb/v1/songs", (req, res) => { if (checkAuth(req, res)) { - returnSongdb(req.header('X-SkuId'), res); + returnSongdb(req.header('X-SkuId') || "jd2022-pc-ww", res); } }); @@ -226,44 +227,44 @@ exports.initroute = (app, express, server) => { app.post("/carousel/v2/pages/:mode", (req, res) => { var search = "" if (req.body.searchString && req.body.searchString != "") { - search = req.body.searchString + search = req.body.searchString } else if (req.body.searchTags && req.body.searchTags != undefined) { - search = req.body.searchTags[0] + search = req.body.searchTags[0] } else { - search = "" + search = "" } let action = null let isPlaylist = false switch (req.params.mode) { - case "party": - case "partycoop": - action = "partyMap" - break + case "party": + case "partycoop": + action = "partyMap" + break - case "sweat": - action = "sweatMap" - break + case "sweat": + action = "sweatMap" + break - case "create-challenge": - action = "create-challenge" - break + case "create-challenge": + action = "create-challenge" + break - case "jd2019-playlists": - case "jd2020-playlists": - case "jd2021-playlists": - case "jd2022-playlists": - isPlaylist = true - break + case "jd2019-playlists": + case "jd2020-playlists": + case "jd2021-playlists": + case "jd2022-playlists": + isPlaylist = true + break } if (isPlaylist) return res.json(core.generatePlaylist().playlistcategory) if (action != null) - return res.send(core.CloneObject(core.generateCarousel(search, action))) + return res.send(core.CloneObject(core.generateCarousel(search, action))) else return res.json({}) -}); + }); app.get("/profile/v2/country", function (request, response) { var country = requestCountry(request); @@ -392,4 +393,17 @@ exports.initroute = (app, express, server) => { }); }); + + + app.get('/openparty/server/:page', function (req, res) { + const filePath = path.join(__dirname, '../page/', req.params.page); + + // Check if the file exists before trying to send it + if (fs.existsSync(filePath)) { + res.sendFile(filePath); + } else { + res.status(404).send('Not Found'); + } + }); + }; diff --git a/package.json b/package.json index 1993bb1..f975906 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-party", - "version": "1.0.0", + "version": "1.1.0", "description": "Ibratabian17's JDU Code", "main": "server.js", "scripts": {