mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-11 07:04:06 -08:00
027dfb2f0a
* ⚡ Enable `esModuleInterop` for /core * ⚡ Adjust imports in /core * ⚡ Enable `esModuleInterop` for /cli * ⚡ Adjust imports in /cli * ⚡ Enable `esModuleInterop` for /nodes-base * ⚡ Adjust imports in /nodes-base * ⚡ Make imports consistent * ⬆️ Upgrade TypeScript to 4.6 (#3109) * ⬆️ Upgrade TypeScript to 4.6 * 📦 Update package-lock.json * 🔧 Avoid erroring on untyped errors * 📘 Fix type error Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
27 lines
665 B
TypeScript
27 lines
665 B
TypeScript
/* eslint-disable @typescript-eslint/unbound-method */
|
|
/* eslint-disable no-console */
|
|
import convict from 'convict';
|
|
import dotenv from 'dotenv';
|
|
import { schema } from './schema';
|
|
|
|
dotenv.config();
|
|
|
|
const config = convict(schema);
|
|
|
|
config.getEnv = config.get;
|
|
|
|
// Overwrite default configuration with settings which got defined in
|
|
// optional configuration files
|
|
if (process.env.N8N_CONFIG_FILES !== undefined) {
|
|
const configFiles = process.env.N8N_CONFIG_FILES.split(',');
|
|
console.log(`\nLoading configuration overwrites from:\n - ${configFiles.join('\n - ')}\n`);
|
|
|
|
config.loadFile(configFiles);
|
|
}
|
|
|
|
config.validate({
|
|
allowed: 'strict',
|
|
});
|
|
|
|
export = config;
|