mirror of
https://github.com/ibratabian17/OpenParty.git
synced 2026-01-15 14:22:54 -03:00
Make the Parameter Following Domain from Settings.json
This commit is contained in:
@@ -8,7 +8,20 @@ const core = {
|
||||
}
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
|
||||
|
||||
const replaceDomainPlaceholder = (obj, domain) => {
|
||||
if (typeof obj === 'string') {
|
||||
return obj.replace('{SettingServerDomainVarOJDP}', domain);
|
||||
} else if (Array.isArray(obj)) {
|
||||
return obj.map(item => replaceDomainPlaceholder(item, domain));
|
||||
} else if (obj !== null && typeof obj === 'object') {
|
||||
const newObj = {};
|
||||
for (const key in obj) {
|
||||
newObj[key] = replaceDomainPlaceholder(obj[key], domain);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
exports.initroute = (app, express, server) => {
|
||||
const prodwsurl = "https://public-ubiservices.ubi.com/"
|
||||
@@ -76,10 +89,10 @@ exports.initroute = (app, express, server) => {
|
||||
});
|
||||
|
||||
app.get("/v1/applications/34ad0f04-b141-4793-bdd4-985a9175e70d/parameters", (req, res) => {
|
||||
res.send(require("../../database/v1/parameters.json"))
|
||||
res.send(replaceDomainPlaceholder(require("../../database/v1/parameters.json"), settings.server.domain));
|
||||
});
|
||||
app.get("/v1/spaces/041c03fa-1735-4ea7-b5fc-c16546d092ca/parameters", (req, res) => {
|
||||
res.send(require("../../database/v1/parameters2.json"))
|
||||
res.send(replaceDomainPlaceholder(require("../../database/v1/parameters2.json"), settings.server.domain))
|
||||
});
|
||||
|
||||
|
||||
|
||||
38
core/var.js
38
core/var.js
@@ -1,7 +1,25 @@
|
||||
const axios = require('axios')
|
||||
const fs = require('fs')
|
||||
const songdb = require('./lib/songdb').songdbF
|
||||
console.log(`[VAR] Initializing....`)
|
||||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
const songdb = require('./lib/songdb').songdbF;
|
||||
const settings = require('../settings.json');
|
||||
|
||||
console.log('[VAR] Initializing....');
|
||||
|
||||
const replaceDomainPlaceholder = (obj, domain) => {
|
||||
if (typeof obj === 'string') {
|
||||
return obj.replace('{SettingServerDomainVarOJDP}', domain);
|
||||
} else if (Array.isArray(obj)) {
|
||||
return obj.map(item => replaceDomainPlaceholder(item, domain));
|
||||
} else if (obj !== null && typeof obj === 'object') {
|
||||
const newObj = {};
|
||||
for (const key in obj) {
|
||||
newObj[key] = replaceDomainPlaceholder(obj[key], domain);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
const main = {
|
||||
skupackages: {
|
||||
pc: require('../database/Platforms/jd2017-pc/sku-packages.json'),
|
||||
@@ -10,8 +28,8 @@ const main = {
|
||||
durango: require('../database/Platforms/jd2017-durango/sku-packages.json'),
|
||||
orbis: require('../database/Platforms/jd2017-orbis/sku-packages.json')
|
||||
},
|
||||
entities: require('../database/v2/entities.json'),
|
||||
configuration: require('../database/v1/configuration.json'),
|
||||
entities: replaceDomainPlaceholder(require('../database/v2/entities.json'), settings.server.domain),
|
||||
configuration: replaceDomainPlaceholder(require('../database/v1/configuration.json'), settings.server.domain),
|
||||
subscription: require('../database/db/subscription.json'),
|
||||
packages: require('../database/packages.json'),
|
||||
block: require('../database/carousel/block.json'),
|
||||
@@ -33,10 +51,10 @@ const main = {
|
||||
create_playlist: require("../database/carousel/pages/create_playlist.json"),
|
||||
songdb: { "2016": {}, "2017": {}, "2018": {}, "2019": {}, "2020": {}, "2021": {}, "2022": {} },
|
||||
localisation: require('../database/Platforms/openparty-all/localisation.json')
|
||||
}
|
||||
};
|
||||
|
||||
main.songdb = songdb.generateSonglist()
|
||||
main.songdb = songdb.generateSonglist();
|
||||
|
||||
module.exports = {
|
||||
main
|
||||
}
|
||||
main
|
||||
}
|
||||
@@ -258,7 +258,7 @@
|
||||
"version": 1
|
||||
}, {
|
||||
"name": "spaces/entities",
|
||||
"url": "http://jdp.justdancenext.xyz/{version}/spaces/{spaceId}/entities",
|
||||
"url": "http://{SettingServerDomainVarOJDP}/{version}/spaces/{spaceId}/entities",
|
||||
"version": 2
|
||||
}, {
|
||||
"name": "spaces/items",
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
},
|
||||
"baseurl_aws": {
|
||||
"China": "https://public-ubiservices.ubisoft.cn",
|
||||
"Standard": "https://jdp.justdancenext.xyz",
|
||||
"Standard": "https://{SettingServerDomainVarOJDP}",
|
||||
"China_GAAP": "https://gaap.ubiservices.ubi.com:12000"
|
||||
},
|
||||
"baseurl_msr": {
|
||||
@@ -101,12 +101,12 @@
|
||||
"us-sdkClientFleet": {
|
||||
"fields": {
|
||||
"title": "",
|
||||
"spaces": "https://jdp.justdancenext.xyz/{version}/spaces/{spaceId}/title/{title}/",
|
||||
"profiles": "https://jdp.justdancenext.xyz/{version}/profiles/{profileId}/title/{title}/",
|
||||
"spaces_all": "https://jdp.justdancenext.xyz/{version}/spaces/title/{title}/",
|
||||
"applications": "https://jdp.justdancenext.xyz/{version}/applications/{applicationId}/title/{title}/",
|
||||
"profiles_all": "https://jdp.justdancenext.xyz/{version}/profiles/title/{title}/",
|
||||
"applications_all": "https://jdp.justdancenext.xyz/{version}/applications/title/{title}/"
|
||||
"spaces": "https://{SettingServerDomainVarOJDP}/{version}/spaces/{spaceId}/title/{title}/",
|
||||
"profiles": "https://{SettingServerDomainVarOJDP}/{version}/profiles/{profileId}/title/{title}/",
|
||||
"spaces_all": "https://{SettingServerDomainVarOJDP}/{version}/spaces/title/{title}/",
|
||||
"applications": "https://{SettingServerDomainVarOJDP}/{version}/applications/{applicationId}/title/{title}/",
|
||||
"profiles_all": "https://{SettingServerDomainVarOJDP}/{version}/profiles/title/{title}/",
|
||||
"applications_all": "https://{SettingServerDomainVarOJDP}/{version}/applications/title/{title}/"
|
||||
},
|
||||
"relatedPopulation": null
|
||||
},
|
||||
|
||||
@@ -854,7 +854,7 @@
|
||||
},
|
||||
"jd-serverInfo": {
|
||||
"fields": {
|
||||
"url": "https://jdp.justdancenext.xyz",
|
||||
"url": "https://{SettingServerDomainVarOJDP}",
|
||||
"name": "PROD"
|
||||
},
|
||||
"relatedPopulation": null
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"tags": [],
|
||||
"obj": {
|
||||
"name": "JMCS PROD",
|
||||
"url": "http://jdp.justdancenext.xyz"
|
||||
"url": "http://{SettingServerDomainVarOJDP}"
|
||||
},
|
||||
"lastModified": "",
|
||||
"revision": 3
|
||||
@@ -19,7 +19,7 @@
|
||||
"tags": [],
|
||||
"obj": {
|
||||
"name": "JMCS PROD",
|
||||
"url": "http://jdp.justdancenext.xyz"
|
||||
"url": "http://{SettingServerDomainVarOJDP}"
|
||||
},
|
||||
"lastModified": "",
|
||||
"revision": 3
|
||||
|
||||
Reference in New Issue
Block a user