actual-server/load-config.js
Arthur E. Jones a7efc82944 fix: suppress missing module error
- code as written expects the file may be absent and has a fallback
  implemented, so the error can be safely ignored. There may be a better
  strategy for dealing with this, however.
2022-05-20 13:58:48 -04:00

20 lines
445 B
JavaScript

let config;
try {
// @ts-expect-error TS2307: we expect this file may not exist
config = require('./config');
} catch (e) {
let fs = require('fs');
let { join } = require('path');
let root = fs.existsSync('/data') ? '/data' : __dirname;
config = {
mode: 'development',
port: 5006,
hostname: '0.0.0.0',
serverFiles: join(root, 'server-files'),
userFiles: join(root, 'user-files')
};
}
module.exports = config;