repo_description: Parse Server for Node.js / Express
repo_topics: baas backend file-storage graphql graphql-api graphql-relay graphql-server hacktoberfest mbaas mongodb nodejs notifications object-storage parse-platform parse-server postgres relay rest-api
code: import { nullParser } from './Options/parsers';
  const { ParseServerOptions, DatabaseOptions } = require('./Options/Definitions');
  const logsFolder = (() => {
    let folder = './logs/';
    if (typeof process !== 'undefined' && process.env.TESTING === '1') {
      folder = './test_logs/';
    }
    if (process.env.PARSE_SERVER_LOGS_FOLDER) {
      folder = nullParser(process.env.PARSE_SERVER_LOGS_FOLDER);
    }
    return folder;
  })();
  
  const { verbose, level } = (() => {
    const verbose = process.env.VERBOSE ? true : false;
    return { verbose, level: verbose ? 'verbose' : undefined };
  })();
  
  const DefinitionDefaults = Object.keys(ParseServerOptions).reduce((memo, key) => {
    const def = ParseServerOptions[key];
    if (Object.prototype.hasOwnProperty.call(def, 'default')) {
      memo[key] = def.default;
    }
    return memo;
  }, {});
  
  const computedDefaults = {
    jsonLogs: process.env.JSON_LOGS || false,
    logsFolder,
    verbose,
    level,
  };
  
  export default Object.assign({}, DefinitionDefaults, computedDefaults);
  export const DefaultMongoURI = DefinitionDefaults.databaseURI;
  
  export const DatabaseOptionDefaults = Object.keys(DatabaseOptions).reduce((memo, key) => {
    const def = DatabaseOptions[key];
    if (Object.prototype.hasOwnProperty.call(def, 'default')) {
      memo[key] = def.default;
    }
    return memo;
  }, {});
  
  // Parse Server-specific database options that should be filtered out
  // before passing to MongoDB client
  export const ParseServerDatabaseOptions = [
    'allowPublicExplain',
    'batchSize',
    'clientMetadata',
    'createIndexAuthDataUniqueness',
    'createIndexRoleName',
    'createIndexUserEmail',
    'createIndexUserEmailCaseInsensitive',
    'createIndexUserEmailVerifyToken',
    'createIndexUserPasswordResetToken',
    'createIndexUserUsername',
    'createIndexUserUsernameCaseInsensitive',
    'disableIndexFieldValidation',
    'enableSchemaHooks',
    'logClientEvents',
    'maxTimeMS',
    'schemaCacheTtl',
  ];
  