src/staticConfig/index.js
function staticConfig (projectPath, app) {
  if (!projectPath) throw new Error('project path is required for load static configs');

  // return configs if already is loaded
  if (app.staticConfigsIsLoad) return app.config;

  // - load and merge project configs

  let projectConfigFolder = app.projectConfigFolder;

  let files = [];

  try {
    files = fs.readdirSync(projectConfigFolder);
  } catch(e) {
    if (e.code != 'ENOENT') console.error('Error on load project config folder: ', e);
  }

  let file;
  for (let i = 0; i < files.length; i++) {
    if (files[i] == 'local.js') continue; // skip locals.js to load after all
    if (!files[i].endsWith('.js')) continue; // only accepts .js config files

    file = path.resolve(projectConfigFolder, files[i]);
    // skip dirs
    if (fs.lstatSync(file).isDirectory()) continue;
    _.merge(app.config, require(file));
  }

  let jsonConfiguration = staticConfig.readJsonConfiguration(projectConfigFolder);
  let localConfigFile = staticConfig.readLocalConfigFile(projectConfigFolder);

  // load project local config file
  _.merge(app.config, jsonConfiguration, localConfigFile);

  app.staticConfigsIsLoad = true;

  return app.config;
}
function staticConfig (projectPath, app) {
  if (!projectPath) throw new Error('project path is required for load static configs');

  // return configs if already is loaded
  if (app.staticConfigsIsLoad) return app.config;

  // - load and merge project configs

  let projectConfigFolder = app.projectConfigFolder;

  let files = [];

  try {
    files = fs.readdirSync(projectConfigFolder);
  } catch(e) {
    if (e.code != 'ENOENT') console.error('Error on load project config folder: ', e);
  }

  let file;
  for (let i = 0; i < files.length; i++) {
    if (files[i] == 'local.js') continue; // skip locals.js to load after all
    if (!files[i].endsWith('.js')) continue; // only accepts .js config files

    file = path.resolve(projectConfigFolder, files[i]);
    // skip dirs
    if (fs.lstatSync(file).isDirectory()) continue;
    _.merge(app.config, require(file));
  }

  let jsonConfiguration = staticConfig.readJsonConfiguration(projectConfigFolder);
  let localConfigFile = staticConfig.readLocalConfigFile(projectConfigFolder);

  // load project local config file
  _.merge(app.config, jsonConfiguration, localConfigFile);

  app.staticConfigsIsLoad = true;

  return app.config;
}
Get project static configs

@param  {String} projectPath project path ( opcional )
@return {Object}             configs