1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- const fs = require('fs');
- const path = require('path');
- const configFilePath = path.join(__dirname, 'oasis-config.json');
- if (!fs.existsSync(configFilePath)) {
- const defaultConfig = {
- "themes": {
- "current": "Dark-SNH"
- },
- "modules": {
- "popularMod": "on",
- "topicsMod": "on",
- "summariesMod": "on",
- "latestMod": "on",
- "threadsMod": "on",
- "multiverseMod": "on",
- "invitesMod": "on",
- "walletMod": "on",
- "legacyMod": "on",
- "cipherMod": "on",
- "bookmarksMod": "on",
- "videosMod": "on",
- "docsMod": "on",
- "audiosMod": "on",
- "tagsMod": "on",
- "imagesMod": "on",
- "trendingMod": "on",
- "eventsMod": "on",
- "tasksMod": "on",
- "marketMod": "on",
- "tribesMod": "on",
- "governanceMod": "on",
- "reportsMod": "on",
- "opinionsMod": "on",
- "transfersMod": "on",
- "feedMod": "on",
- "pixeliaMod": "on",
- "agendaMod": "on",
- "aiMod": "on"
- },
- "wallet": {
- "url": "http://localhost:7474",
- "user": "ecoinrpc",
- "pass": "",
- "fee": "1"
- }
- };
- fs.writeFileSync(configFilePath, JSON.stringify(defaultConfig, null, 2));
- }
- const getConfig = () => {
- const configData = fs.readFileSync(configFilePath);
- return JSON.parse(configData);
- };
- const saveConfig = (newConfig) => {
- fs.writeFileSync(configFilePath, JSON.stringify(newConfig, null, 2));
- };
- module.exports = {
- getConfig,
- saveConfig,
- };
|