{"size": 734, "ext": "js", "max_stars_repo_path": "config/index.js", "max_stars_repo_name": "tiendq/shopify-promobar", "max_stars_repo_stars_event_min_datetime": "2019-06-07T18:34:35.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-06T02:05:35.000Z", "max_issues_repo_path": "config/index.js", "max_issues_repo_name": "tiendq/shopify-promobar", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "config/index.js", "max_forks_repo_name": "tiendq/shopify-promobar", "max_forks_repo_forks_event_min_datetime": "2020-01-04T09:21:29.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-04T09:21:29.000Z"}
{"max_stars_count": 6, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 27.1851851852, "max_line_length": 61, "alphanum_fraction": 0.7220708447}
const dotenv = require('dotenv-safe');
const development = require('./development');
const production = require('./production');
const staging = require('./staging');

if ('development' === process.env.NODE_ENV) {
  let { parsed } = dotenv.config({ silent: true });
  console.info('Environment variables:');
  console.info(parsed);
}

let config = null;

if ('development' === process.env.NODE_ENV)
  config = development;
else if ('staging' === process.env.NODE_ENV)
  config = staging;
else
  config = production;

config.mongodb.url = process.env.DB_URL;
config.shopify.apiKey = process.env.SHOPIFY_API_KEY;
config.shopify.apiSecretKey = process.env.SHOPIFY_SECRET_KEY;
config.url = process.env.HOST_URL;

module.exports = config;
