0
0
Fork 0

Split streaming server from web server (#24702)

This commit is contained in:
Emelia Smith 2023-11-14 18:43:20 +01:00 committed by GitHub
parent 36d7d1781f
commit 15b2d7eec5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 108 additions and 75 deletions

View file

@ -2,6 +2,7 @@
const fs = require('fs');
const http = require('http');
const path = require('path');
const url = require('url');
const dotenv = require('dotenv');
@ -17,8 +18,11 @@ const WebSocket = require('ws');
const environment = process.env.NODE_ENV || 'development';
// Correctly detect and load .env or .env.production file based on environment:
const dotenvFile = environment === 'production' ? '.env.production' : '.env';
dotenv.config({
path: environment === 'production' ? '.env.production' : '.env',
path: path.resolve(__dirname, path.join('..', dotenvFile))
});
log.level = process.env.LOG_LEVEL || 'verbose';