diff --git a/packages/backend/src/config.js b/packages/backend/src/config.js index cecd3a89..0abf9515 100644 --- a/packages/backend/src/config.js +++ b/packages/backend/src/config.js @@ -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`, }; diff --git a/packages/backend/src/helpers.js b/packages/backend/src/helpers.js index 8a04ae42..224e907f 100644 --- a/packages/backend/src/helpers.js +++ b/packages/backend/src/helpers.js @@ -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)); }