forked from svrjs/svrjs
Replace __dirname with process.dirname
This commit is contained in:
parent
9b8ccd31fc
commit
1fbede69e5
1 changed files with 2 additions and 2 deletions
|
@ -215,10 +215,10 @@ const {
|
||||||
process.serverConfig = {};
|
process.serverConfig = {};
|
||||||
let configJSONRErr = undefined;
|
let configJSONRErr = undefined;
|
||||||
let configJSONPErr = undefined;
|
let configJSONPErr = undefined;
|
||||||
if (fs.existsSync(__dirname + "/config.json")) {
|
if (fs.existsSync(process.dirname + "/config.json")) {
|
||||||
let configJSONf = "";
|
let configJSONf = "";
|
||||||
try {
|
try {
|
||||||
configJSONf = fs.readFileSync(__dirname + "/config.json"); // Read JSON File
|
configJSONf = fs.readFileSync(process.dirname + "/config.json"); // Read JSON File
|
||||||
try {
|
try {
|
||||||
process.serverConfig = JSON.parse(configJSONf); // Parse JSON
|
process.serverConfig = JSON.parse(configJSONf); // Parse JSON
|
||||||
} catch (err2) {
|
} catch (err2) {
|
||||||
|
|
Reference in a new issue