conditionally load dotenv

pull/329/head
Jonathan Tsai 2020-12-29 02:26:27 +00:00
parent b6b50a102b
commit ee6d97fd7f
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,3 @@
require('dotenv').config();
var http = require('http');
var fs = require('fs');
@ -18,6 +16,10 @@ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
config.port = process.env.PORT || config.port || 7777;
config.host = process.env.HOST || config.host || 'localhost';
if (config.dotEnv) {
require('dotenv').config();
}
// Set up the logger
if (config.logging) {
try {