Skip to content

Commit

Permalink
Make sure APIKEY.txt is read from the correct directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rhansen committed Sep 7, 2021
1 parent 48678fa commit 46b4786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apiUtils.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

const absolutePaths = require('ep_etherpad-lite/node/utils/AbsolutePaths');
const fs = require('fs');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const settings = require('ep_etherpad-lite/node/utils/Settings');

// ensure we have an apiKey
let apiKey = '';
try {
apiKey = fs.readFileSync('./APIKEY.txt', 'utf8').trim();
apiKey = fs.readFileSync(absolutePaths.makeAbsolute('./APIKEY.txt'), 'utf8').trim();
} catch (e) {
console.warn('Could not find APIKEY');
}
Expand Down

0 comments on commit 46b4786

Please sign in to comment.