Move config files to new directory

This commit is contained in:
Essem 2022-07-26 10:38:42 -05:00
parent 6a409283af
commit 81ff5ae0ab
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
11 changed files with 10 additions and 10 deletions

View file

@ -8,7 +8,7 @@ export const jobs = {};
export const connections = new Map();
export const servers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
export const servers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
export async function getType(image, extraReturnTypes) {
if (!image.startsWith("http")) {

View file

@ -24,7 +24,7 @@ export async function clean(text) {
.replaceAll("@", `@${String.fromCharCode(8203)}`);
const { parsed } = config();
const imageServers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
const imageServers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
if (imageServers?.length !== 0) {
for (const { server, auth } of imageServers) {

View file

@ -23,7 +23,7 @@ class ImageWorker extends BaseServiceWorker {
if (process.env.API_TYPE === "ws") {
this.connections = new Map();
this.servers = JSON.parse(fs.readFileSync(new URL("../../servers.json", import.meta.url), { encoding: "utf8" })).image;
this.servers = JSON.parse(fs.readFileSync(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
this.nextID = 0;
} else if (process.env.API_TYPE === "azure") {
this.jobs = new Map();
@ -115,7 +115,7 @@ class ImageWorker extends BaseServiceWorker {
}
async repopulate() {
const data = await fs.promises.readFile(new URL("../../servers.json", import.meta.url), { encoding: "utf8" });
const data = await fs.promises.readFile(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" });
this.servers = JSON.parse(data).image;
return;
}

View file

@ -14,7 +14,7 @@ export let status = false;
export let connected = false;
export async function checkStatus() {
const json = await fs.promises.readFile(new URL("../servers.json", import.meta.url), { encoding: "utf8" });
const json = await fs.promises.readFile(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" });
nodes = JSON.parse(json).lava;
const newNodes = [];
for (const node of nodes) {