th: 12-factor ~~authentication~~ apps were a mistake

pull/62/head
kouhai dev 2023-05-22 00:11:41 -07:00
parent 2408f1046f
commit aeaeed71f3
1 changed files with 12 additions and 2 deletions

View File

@ -13,10 +13,20 @@ const fs = require('fs');
const WebSocket = require('ws'); const WebSocket = require('ws');
const { JSDOM } = require('jsdom'); const { JSDOM } = require('jsdom');
const environment = process.env.NODE_ENV || 'development'; const environment = process.env.NODE_ENV !== 'development' ? 'production' : 'development';
// Replicate dotenv-rails's behavior
dotenv.config({ dotenv.config({
path: environment === 'production' ? '.env.production' : '.env', path: '.env',
});
dotenv.config({
path: environment === 'production' ? '.env.production' : '.env.development',
});
dotenv.config({
path: '.env.local',
});
dotenv.config({
path: environment === 'production' ? '.env.production.local' : '.env.development.local',
}); });
log.level = process.env.LOG_LEVEL || 'verbose'; log.level = process.env.LOG_LEVEL || 'verbose';