did stuff

This commit is contained in:
legop3
2025-11-13 13:54:14 -05:00
parent 4d5a918921
commit d601e9aa82
22 changed files with 565 additions and 13 deletions
+20
View File
@@ -0,0 +1,20 @@
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
const CONFIG_PATH = process.env.SERVER_CONFIG || path.join(__dirname, '..', '..', 'config.yaml');
let cachedConfig;
function loadConfig() {
if (cachedConfig) {
return cachedConfig;
}
const file = fs.readFileSync(CONFIG_PATH, 'utf8');
cachedConfig = yaml.load(file);
return cachedConfig;
}
module.exports = {
loadConfig,
};