This commit is contained in:
me 2025-03-15 11:57:56 +02:00
parent bbe4dc87ab
commit 677f80c760
2 changed files with 5 additions and 5 deletions

View File

@ -7,6 +7,6 @@ const configuration = config.util.toObject();
export default { export default {
config: configuration, config: configuration,
getSite: (site_url) => { getSite: (site_url) => {
return config.sites[site_url]; return configuration.sites[site_url];
} }
}; };

View File

@ -4,15 +4,15 @@ import config from './config.mjs';
// Constants // 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() { const cors = (function() {
let origins = new Set(); 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) }); config.sites[site].cors.forEach(origin => {origins.add(origin) });
} }
return Array.from(origins); return Array.from(origins);