From ad627e65967ffe9b2da949e48318bd90c7680d89 Mon Sep 17 00:00:00 2001 From: Bill Church Date: Sat, 17 Aug 2024 16:19:19 +0000 Subject: [PATCH] chore: Update config.js to read config file synchronously and merge configuration --- app/config.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/config.js b/app/config.js index 8cd3ccd..3275a0c 100644 --- a/app/config.js +++ b/app/config.js @@ -271,13 +271,13 @@ function getConfigPath() { } /** - * Reads the config file + * Reads the config file synchronously * @param {string} configPath - The path to the config file - * @returns {Config} The configuration object + * @returns {Object} The configuration object */ function readConfigFile(configPath) { console.log("WebSSH2 service reading config from: " + configPath) - return readConfig(configPath) + return readConfig.sync(configPath) } /** @@ -312,8 +312,8 @@ function logError(message, error) { } /** - * Loads and merges the configuration - * @returns {Config} The merged configuration + * Loads and merges the configuration synchronously + * @returns {Object} The merged configuration */ function loadConfig() { const configPath = getConfigPath() @@ -376,9 +376,10 @@ function deepMerge(target, source) { } return target } + /** * The loaded configuration - * @type {Config} + * @type {Object} */ const config = loadConfig()