small fixes to build process for documentation search pull
This commit is contained in:
parent
8c03b321fc
commit
b2641f9daa
@ -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 = {
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user