This script loads environment variables from a .env file. It checks multiple possible paths for the .env file and loads the first one that exists. If no .env file is found, it logs an error message with the attempted paths. The loaded configuration is then exported for use in other parts of the application. * @property {Object} CONFIG - An object containing the loaded configuration.
Properties
NameTypeDescription
CONFIG.hoststringThe host value from the .env file.
CONFIG.tokenstringThe token value from the .env file.
CONFIG.tokenSlavestringThe tokenSlave value from the .env file.
Example
import CONFIG from './config.js';
console.log(CONFIG.host); // Outputs the host value from the .env file