salix/services/print/application/config.js

23 lines
552 B
JavaScript

var path = require('path');
let defaultFile = 'datasources.json';
function getFile(fileName) {
return require(path.join(__dirname, `/config/${fileName}`));
}
try {
let envFile = 'datasources.development.json';
if (process.env.NODE_ENV === 'test')
envFile = 'datasources.test.json';
config = getFile(envFile);
} catch (e) {
if (e.code == 'MODULE_NOT_FOUND')
config = getFile(defaultFile);
}
config.proxy = require('../../nginx/config.json');
config.package = require('../package.json');
module.exports = config;