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 we're in production and the request is not from localhost
|
||||||
if (config.isProduction && req.hostname !== 'localhost' && !req.hostname.includes('127.0.0.1')) {
|
if (config.isProduction && req.hostname !== 'localhost' && !req.hostname.includes('127.0.0.1')) {
|
||||||
// Use the domain from config
|
// Use the configured MKDOCS_URL from environment
|
||||||
const mainDomain = config.domain;
|
mkdocsUrl = config.mkdocs.url;
|
||||||
mkdocsUrl = `https://${mainDomain}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = {
|
const response = {
|
||||||
|
|||||||
@ -113,7 +113,7 @@ app.use(cors({
|
|||||||
const allowedOrigins = [
|
const allowedOrigins = [
|
||||||
`https://${config.domain}`,
|
`https://${config.domain}`,
|
||||||
`https://map.${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}`
|
`https://admin.${config.domain}`
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ app.get('/api/version', (req, res) => {
|
|||||||
app.get('/api/docs-search', async (req, res) => {
|
app.get('/api/docs-search', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const docsUrl = config.isProduction ?
|
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';
|
'http://localhost:8000/search/search_index.json';
|
||||||
|
|
||||||
const response = await fetch(docsUrl);
|
const response = await fetch(docsUrl);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user