Use convict for configuration to make n8n easier to configure

This commit is contained in:
Jan Oberhauser
2019-07-21 19:47:41 +02:00
parent fbaf445bf8
commit d027545986
15 changed files with 234 additions and 114 deletions

View File

@@ -1,4 +1,4 @@
import * as config from 'config';
import * as config from '../config';
import * as express from 'express';
@@ -25,9 +25,9 @@ export function logOutput(message: string, level = 'log'): void {
* @returns {string}
*/
export function getBaseUrl(): string {
const protocol = config.get('urls.protocol') as string;
const host = config.get('urls.host') as string;
const port = config.get('urls.port') as number;
const protocol = config.get('protocol') as string;
const host = config.get('host') as string;
const port = config.get('port') as number;
if (protocol === 'http' && port === 80 || protocol === 'https' && port === 443) {
return `${protocol}://${host}/`;