2019-01-22 08:55:35 +00:00
|
|
|
const fs = require('fs-extra');
|
|
|
|
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
|
|
|
|
|
2019-01-22 10:48:00 +00:00
|
|
|
let configPath = `/etc/salix`;
|
2019-01-22 08:55:35 +00:00
|
|
|
let config = require('../config/print.json');
|
|
|
|
let configFiles = [
|
2019-01-23 08:33:58 +00:00
|
|
|
`${appPath}/config/print.${env}.json`,
|
2019-01-22 08:55:35 +00:00
|
|
|
`${configPath}/print.json`,
|
|
|
|
`${configPath}/print.${env}.json`
|
|
|
|
];
|
|
|
|
|
|
|
|
for (let configFile of configFiles) {
|
|
|
|
if (fs.existsSync(configFile))
|
|
|
|
Object.assign(config, require(configFile));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* let proxyConf = {};
|
|
|
|
let proxyFiles = [
|
|
|
|
'../../nginx/config.yml',
|
|
|
|
`${configPath}/config.yml`,
|
|
|
|
`${configPath}/config.${env}.yml`
|
|
|
|
];
|
|
|
|
|
|
|
|
for (let proxyFile of proxyFiles) {
|
|
|
|
if (fs.existsSync(proxyFile))
|
|
|
|
Object.assign(proxyConf, require(proxyFile));
|
|
|
|
} */
|
|
|
|
|
|
|
|
// config.proxy = proxyConf;
|
|
|
|
config.env = env;
|
|
|
|
|
|
|
|
module.exports = config;
|