src/platformsh.js
function config() {
  if(!process.env.PLATFORM_PROJECT) {
    throw Error('This is not running on platform.sh');
  }

  return {
    application: read_base64_json('PLATFORM_APPLICATION'),
    relationships: read_base64_json('PLATFORM_RELATIONSHIPS'),
    variables: read_base64_json('PLATFORM_VARIABLES'),
    application_name: process.env.PLATFORM_APPLICATION_NAME,
    app_dir: process.env.PLATFORM_APP_DIR,
    environment: process.env.PLATFORM_ENVIRONMENT,
    project: process.env.PLATFORM_PROJECT,
    routes: read_base64_json('PLATFORM_ROUTES'),
    tree_id: process.env.PLATFORM_TREE_ID,
    project_entropy: process.env.PLATFORM_PROJECT_ENTROPY,
    branch: process.env.PLATFORM_BRANCH,
    document_root: process.env.PLATFORM_DOCUMENT_ROOT,
    port: process.env.PORT,
    omp_num_threads: num_of_cpus()
  };
}
function config() {
  if(!process.env.PLATFORM_PROJECT) {
    throw Error('This is not running on platform.sh');
  }

  return {
    application: read_base64_json('PLATFORM_APPLICATION'),
    relationships: read_base64_json('PLATFORM_RELATIONSHIPS'),
    variables: read_base64_json('PLATFORM_VARIABLES'),
    application_name: process.env.PLATFORM_APPLICATION_NAME,
    app_dir: process.env.PLATFORM_APP_DIR,
    environment: process.env.PLATFORM_ENVIRONMENT,
    project: process.env.PLATFORM_PROJECT,
    routes: read_base64_json('PLATFORM_ROUTES'),
    tree_id: process.env.PLATFORM_TREE_ID,
    project_entropy: process.env.PLATFORM_PROJECT_ENTROPY,
    branch: process.env.PLATFORM_BRANCH,
    document_root: process.env.PLATFORM_DOCUMENT_ROOT,
    port: process.env.PORT,
    omp_num_threads: num_of_cpus()
  };
}
function config ( ) { if ( ! process . env . PLATFORM_PROJECT ) { throw Error ( 'This is not running on platform.sh' ) ; } return { application : read_base64_json ( 'PLATFORM_APPLICATION' ) , relationships : read_base64_json ( 'PLATFORM_RELATIONSHIPS' ) , variables : read_base64_json ( 'PLATFORM_VARIABLES' ) , application_name : process . env . PLATFORM_APPLICATION_NAME , app_dir : process . env . PLATFORM_APP_DIR , environment : process . env . PLATFORM_ENVIRONMENT , project : process . env . PLATFORM_PROJECT , routes : read_base64_json ( 'PLATFORM_ROUTES' ) , tree_id : process . env . PLATFORM_TREE_ID , project_entropy : process . env . PLATFORM_PROJECT_ENTROPY , branch : process . env . PLATFORM_BRANCH , document_root : process . env . PLATFORM_DOCUMENT_ROOT , port : process . env . PORT , omp_num_threads : num_of_cpus ( ) } ; }
Reads Platform.sh configuration from environment and returns a single object
Reads Platform . sh configuration from environment and returns a single object