salix/services/mailer/application/config.js

24 lines
557 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;