src/server/config-loader.js
/**
 * Sanitizes config instance object
 * @param {module:config-loader.Config} config Configuration object
 */
Sanitizes config instance object
@param {module:config-loader.Config} config Configuration object
Sanitizes config instance object @param { module : config - loader . Config } config Configuration object
function __sanitizeConfigObj_instance(config)
{
    if(!config.hasOwnProperty("instance"))
        config.instance = {};
    if(!config.instance.hasOwnProperty("id"))
    {
        let message = "Missing instance.id. ";
        if(typeof process.env.SPLASH_INSTANCE_ID !== "undefined" && process.env.SPLASH_INSTANCE_ID.length > 0)
        {
            config.instance.id = process.env.SPLASH_INSTANCE_ID;
            message += "Setting instance ID from environment variable";
        }
        else
        {
            config.instance.id = uuidv4();
            message += "Generating a random ID.";
        }
        Core.logger.log(Core.LOG_LEVEL.WARN, message);
    }
}
function __sanitizeConfigObj_instance ( config ) { if ( ! config . hasOwnProperty ( "instance" ) ) config . instance = { } ; if ( ! config . instance . hasOwnProperty ( "id" ) ) { let message = "Missing instance.id. " ; if ( typeof process . env . SPLASH_INSTANCE_ID !== "undefined" && process . env . SPLASH_INSTANCE_ID . length > 0 ) { config . instance . id = process . env . SPLASH_INSTANCE_ID ; message += "Setting instance ID from environment variable" ; } else { config . instance . id = uuidv4 ( ) ; message += "Generating a random ID." ; } Core . logger . log ( Core . LOG_LEVEL . WARN , message ) ; } }
Sanitizes config instance object
 @param {module:config-loader.Config} config Configuration object
Sanitizes config instance object @param { module : config - loader . Config } config Configuration object
// Generate instance.id from UUIDv4 if not present