From 677f80c7603cf4a9196d05ee3a089db59f9f8d1b Mon Sep 17 00:00:00 2001 From: me Date: Sat, 15 Mar 2025 11:57:56 +0200 Subject: [PATCH] oops --- backend/src/config.mjs | 2 +- backend/src/utils.mjs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/config.mjs b/backend/src/config.mjs index 6fb2ad7..1f75036 100644 --- a/backend/src/config.mjs +++ b/backend/src/config.mjs @@ -7,6 +7,6 @@ const configuration = config.util.toObject(); export default { config: configuration, getSite: (site_url) => { - return config.sites[site_url]; + return configuration.sites[site_url]; } }; diff --git a/backend/src/utils.mjs b/backend/src/utils.mjs index bb3a441..151d772 100644 --- a/backend/src/utils.mjs +++ b/backend/src/utils.mjs @@ -4,15 +4,15 @@ import config from './config.mjs'; // Constants -const domain = process.env.DOMAIN || config.domain || "localhost"; +const domain = process.env.DOMAIN || config.config.domain || "localhost"; -const port = process.env.PORT || config.port || 8080; +const port = process.env.PORT || config.config.port || 8080; -const db_path = process.env.DB || config.db_path || "ucs.db"; +const db_path = process.env.DB || config.config.db_path || "ucs.db"; const cors = (function() { let origins = new Set(); - for (const site in config.sites) { + for (const site in config.config.sites) { config.sites[site].cors.forEach(origin => {origins.add(origin) }); } return Array.from(origins);