src/server/config-loader.js
/**
 * Sanitizes config server object
 *
 * @private
 * @param {module:config-loader.Config} config Configuration object
 */
Sanitizes config server object
@private
@param {module:config-loader.Config} config Configuration object
Sanitizes config server object @private @param { module : config - loader . Config } config Configuration object
function __sanitizeConfigObj_server(config)
{
    if(!config.hasOwnProperty("server"))
    {
        config.server = {};
        Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server configuration. Generating default server configuration`);
    }
    if(config.server.hasOwnProperty("port"))
        Core.logger.log(Core.LOG_LEVEL.WARN, `server.port is deprecated and will not be supported in future versions`);
    if(!config.server.hasOwnProperty("listen_port"))
    {
        if(config.server.hasOwnProperty("port"))
        {
            config.server.listen_port = config.server.port;
            Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server.listen_port. Setting server.listen_port to server.port`);
        }
        else
        {
            config.server.listen_port = "8080";
            Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server.listen_port. Setting to default server listen port`);
        }
    }
    if(!config.server.hasOwnProperty("public_port"))
    {
        if(config.server.hasOwnProperty("port"))
        {
            config.server.public_port = config.server.port;
            Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server.public_port. Setting server.public_port to server.port`);
        }
        else if(config.server.hasOwnProperty("listen_port"))
        {
            config.server.public_port = config.server.listen_port;
            Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server.public_port. Setting server.public_port to server.listen_port`);
        }
        else
        {
            config.server.public_port = "8080";
            Core.logger.log(Core.LOG_LEVEL.WARN, `Missing server.public_port. Setting to default server public port`);
        }
    }
}
function __sanitizeConfigObj_server ( config ) { if ( ! config . hasOwnProperty ( "server" ) ) { config . server = { } ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } if ( config . server . hasOwnProperty ( "port" ) ) Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; if ( ! config . server . hasOwnProperty ( "listen_port" ) ) { if ( config . server . hasOwnProperty ( "port" ) ) { config . server . listen_port = config . server . port ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } else { config . server . listen_port = "8080" ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } } if ( ! config . server . hasOwnProperty ( "public_port" ) ) { if ( config . server . hasOwnProperty ( "port" ) ) { config . server . public_port = config . server . port ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } else if ( config . server . hasOwnProperty ( "listen_port" ) ) { config . server . public_port = config . server . listen_port ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } else { config . server . public_port = "8080" ; Core . logger . log ( Core . LOG_LEVEL . WARN , ` ` ) ; } } }
Sanitizes config server object
 @private
 @param {module:config-loader.Config} config Configuration object
Sanitizes config server object @private @param { module : config - loader . Config } config Configuration object