1
0
Fork 0
forked from svrjs/svrjs

Replace __dirname with process.dirname

This commit is contained in:
Dorian Niemiec 2024-08-26 07:05:04 +02:00
parent 9b8ccd31fc
commit 1fbede69e5

View file

@ -215,10 +215,10 @@ const {
process.serverConfig = {};
let configJSONRErr = undefined;
let configJSONPErr = undefined;
if (fs.existsSync(__dirname + "/config.json")) {
if (fs.existsSync(process.dirname + "/config.json")) {
let configJSONf = "";
try {
configJSONf = fs.readFileSync(__dirname + "/config.json"); // Read JSON File
configJSONf = fs.readFileSync(process.dirname + "/config.json"); // Read JSON File
try {
process.serverConfig = JSON.parse(configJSONf); // Parse JSON
} catch (err2) {