diff --git a/map/app/routes/index.js b/map/app/routes/index.js index 7a26a92..af7c36d 100644 --- a/map/app/routes/index.js +++ b/map/app/routes/index.js @@ -141,9 +141,8 @@ module.exports = (app) => { // If we're in production and the request is not from localhost if (config.isProduction && req.hostname !== 'localhost' && !req.hostname.includes('127.0.0.1')) { - // Use the domain from config - const mainDomain = config.domain; - mkdocsUrl = `https://${mainDomain}`; + // Use the configured MKDOCS_URL from environment + mkdocsUrl = config.mkdocs.url; } const response = { diff --git a/map/app/server.js b/map/app/server.js index 9995646..8fcdcda 100644 --- a/map/app/server.js +++ b/map/app/server.js @@ -113,7 +113,7 @@ app.use(cors({ const allowedOrigins = [ `https://${config.domain}`, `https://map.${config.domain}`, - `https://docs.${config.domain}`, + config.mkdocs.url, // Use configured MkDocs URL instead of hardcoded subdomain `https://admin.${config.domain}` ]; @@ -159,7 +159,7 @@ app.get('/api/version', (req, res) => { app.get('/api/docs-search', async (req, res) => { try { const docsUrl = config.isProduction ? - `https://docs.${config.domain}/search/search_index.json` : + `${config.mkdocs.searchUrl}/search/search_index.json` : 'http://localhost:8000/search/search_index.json'; const response = await fetch(docsUrl);