Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axios = require('axios')
- const CONFIG_URL = "https://download.djaul.com/config.php"
- async function getWebConfig() {
- console.log("getWebConfig")
- let result;
- try{
- result = await axios
- .get(CONFIG_URL)
- }catch(e){
- console.log(e);
- }
- return result;
- }
- function setLocalConfig(data) {
- console.log("setLocalConfig")
- return {
- debug: true,
- server_name: data.server_name,
- url: {
- logo: data.logo_url,
- site: data.site_url,
- discord: data.discord_url,
- forum: data.forum_url,
- vote: data.vote_url,
- files: data.files_url,
- clientDownload: data.download_url,
- updater: data.updater_url
- },
- menu: [
- { label: "Mettre à jour" },
- { label: "Lancer Djaul" },
- { label: "Voter sur RPG" },
- { label: "Quitter le launcher" }
- ]
- }
- }
- //create an async function that can use `await`
- async function runConfig(){
- const webConfig = await getWebConfig();
- const localConfig = setLocalConfig(webConfig);
- };
- runConfig();
- module.exports = localConfig
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement