salix/services/mailer/application/config.js

22 lines
632 B
JavaScript

require('require-yaml');
var fs = require('fs-extra');
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
let config = require(`${__dirname}/config/datasources.json`);
let configEnvFile = `${__dirname}/config/datasources.${env}.json`;
if (fs.existsSync(configEnvFile))
Object.assign(config, require(configEnvFile));
let proxyConf = require(`../../nginx/config.yml`);
let proxyEnvFile = `../../nginx/config.${env}.yml`;
if (fs.existsSync(proxyEnvFile))
Object.assign(proxyConf, require(proxyEnvFile));
config.proxy = proxyConf;
config.package = require('../package.json');
module.exports = config;