20 lines
490 B
JavaScript
20 lines
490 B
JavaScript
const fs = require('fs-extra');
|
|
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
|
|
|
|
let configPath = `/etc/salix`;
|
|
let config = require('../config/print.json');
|
|
let configFiles = [
|
|
`${appPath}/config/print.${env}.json`,
|
|
`${configPath}/print.json`,
|
|
`${configPath}/print.${env}.json`
|
|
];
|
|
|
|
for (let configFile of configFiles) {
|
|
if (fs.existsSync(configFile))
|
|
Object.assign(config, require(configFile));
|
|
}
|
|
|
|
config.env = env;
|
|
|
|
module.exports = config;
|