Printer & mailer volume path

This commit is contained in:
Joan Sanchez 2018-05-28 12:49:56 +02:00
parent 5199ca62f4
commit 222f7d6249
2 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,8 @@
require('require-yaml');
const fs = require('fs-extra');
let configPath = '/config';
let nginxConfigPath = '/nginx';
const package = require('../package.json');
let configPath = `/config/${package.name}`;
let nginxConfigPath = '/config/nginx';
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
@ -11,19 +12,19 @@ if (env === 'development') {
}
let config = require(`${configPath}/datasources.json`);
let configEnvFile = `${__dirname}/config/datasources.${env}.json`;
let configEnvFile = `${configPath}/datasources.${env}.json`;
if (fs.existsSync(configEnvFile))
Object.assign(config, require(configEnvFile));
let proxyConf = require(`${nginxConfigPath}/config.yml`);
let proxyEnvFile = `../../nginx/config.${env}.yml`;
let proxyEnvFile = `${nginxConfigPath}/config.${env}.yml`;
if (fs.existsSync(proxyEnvFile))
Object.assign(proxyConf, require(proxyEnvFile));
config.proxy = proxyConf;
config.package = require('../package.json');
config.package = package;
config.env = env;
module.exports = config;

View File

@ -1,7 +1,8 @@
require('require-yaml');
const fs = require('fs-extra');
let configPath = '/config';
let nginxConfigPath = '/nginx';
const package = require('../package.json');
let configPath = `/config/${package.name}`;
let nginxConfigPath = '/config/nginx';
let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
@ -11,19 +12,19 @@ if (env === 'development') {
}
let config = require(`${configPath}/datasources.json`);
let configEnvFile = `${__dirname}/config/datasources.${env}.json`;
let configEnvFile = `${configPath}/datasources.${env}.json`;
if (fs.existsSync(configEnvFile))
Object.assign(config, require(configEnvFile));
let proxyConf = require(`${nginxConfigPath}/config.yml`);
let proxyEnvFile = `../../nginx/config.${env}.yml`;
let proxyEnvFile = `${nginxConfigPath}/config.${env}.yml`;
if (fs.existsSync(proxyEnvFile))
Object.assign(proxyConf, require(proxyEnvFile));
config.proxy = proxyConf;
config.package = require('../package.json');
config.package = package;
config.env = env;
module.exports = config;