conditionally load dotenv
This commit is contained in:
parent
b6b50a102b
commit
ee6d97fd7f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user