Add experimental_no_subdomain flag

This commit is contained in:
KernelDeimos 2024-04-05 16:20:27 -04:00
parent 1c2e4968e2
commit fe88880486
2 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,9 @@ const computed_defaults = {
pub_port: config => config.http_port,
origin: config => config.protocol + '://' + config.domain +
(config.pub_port !== 80 && config.pub_port !== 443 ? ':' + config.pub_port : ''),
api_base_url: config => config.protocol + '://api.' + config.domain +
api_base_url: config => config.experimental_no_subdomain
? config.origin
: config.protocol + '://api.' + config.domain +
(config.pub_port !== 80 && config.pub_port !== 443 ? ':' + config.pub_port : ''),
social_card: config => `${config.origin}/assets/img/screenshot.png`,
};

View File

@ -1128,6 +1128,7 @@ async function deleteUser(user_id){
}
function subdomain(req){
if ( config.experimental_no_subdomain ) return 'api';
return req.hostname.slice(0, -1 * (config.domain.length + 1));
}