enigma-bbs/core/web_util.js

18 lines
432 B
JavaScript
Raw Normal View History

2023-03-18 00:40:54 +00:00
const Config = require('./config').get;
// deps
const { get, isString } = require('lodash');
exports.getWebDomain = getWebDomain;
function getWebDomain() {
const config = Config();
const overridePrefix = get(config, 'contentServers.web.overrideUrlPrefix');
if (isString(overridePrefix)) {
const url = new URL(overridePrefix);
return url.hostname;
}
return config.contentServers.web.domain;
}