small fixes to build process for documentation search pull

This commit is contained in:
admin 2025-08-10 18:27:39 -06:00
parent 8c03b321fc
commit b2641f9daa
2 changed files with 4 additions and 5 deletions

View File

@ -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 = {

View File

@ -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);