salix/services/print/application/config.js

22 lines
632 B
JavaScript
Raw Normal View History

require('require-yaml');
2018-02-03 21:53:02 +00:00
var fs = require('fs-extra');
2017-11-27 14:08:18 +00:00
2018-02-03 21:53:02 +00:00
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
2017-11-27 14:08:18 +00:00
2018-02-03 21:53:02 +00:00
let config = require(`${__dirname}/config/datasources.json`);
let configEnvFile = `${__dirname}/config/datasources.${env}.json`;
2018-02-03 21:53:02 +00:00
if (fs.existsSync(configEnvFile))
Object.assign(config, require(configEnvFile));
2017-12-27 08:44:27 +00:00
let proxyConf = require(`../../nginx/config.yml`);
let proxyEnvFile = `../../nginx/config.${env}.yml`;
2017-11-27 14:08:18 +00:00
2018-02-03 21:53:02 +00:00
if (fs.existsSync(proxyEnvFile))
Object.assign(proxyConf, require(proxyEnvFile));
config.proxy = proxyConf;
2017-11-27 14:08:18 +00:00
config.package = require('../package.json');
2018-02-03 21:53:02 +00:00
module.exports = config;