MCPcopy Index your code
hub / github.com/MagicMirrorOrg/MagicMirror / getEnvVarsAsObj

Function getEnvVarsAsObj

js/server_functions.js:232–242  ·  view source on GitHub ↗

* Gets environment variables needed in the browser. * @returns {object} environment variables key: values

()

Source from the content-addressed store, hash-verified

230 * @returns {object} environment variables key: values
231 */
232function getEnvVarsAsObj () {
233 const obj = { modulesDir: `${global.config.foreignModulesDir}`, defaultModulesDir: `${global.config.defaultModulesDir}`, customCss: `${global.config.customCss}` };
234 if (process.env.MM_MODULES_DIR) {
235 obj.modulesDir = process.env.MM_MODULES_DIR.replace(`${global.root_path}/`, "");
236 }
237 if (process.env.MM_CUSTOMCSS_FILE) {
238 obj.customCss = process.env.MM_CUSTOMCSS_FILE.replace(`${global.root_path}/`, "");
239 }
240
241 return obj;
242}
243
244/**
245 * Gets environment variables needed in the browser.

Callers 2

getEnvVarsFunction · 0.85
AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected