feat: Update .env.example and Docker Compose configurations to enhance service performance and health checks. Adjust OCR settings for improved document processing efficiency, and refine API Gateway health checks for better service monitoring. Revise desktop application documentation to reflect new API Gateway URL and installation instructions.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/** URL por defecto del API Gateway (dev: local Docker; instalador: pys1.builder.xyz). */
|
||||
export const DEFAULT_API_BASE_URL: string = __DEFAULT_API_BASE_URL__;
|
||||
|
||||
/** Reemplaza localhost por 127.0.0.1 para evitar problemas de IPv6 en Windows/Docker. */
|
||||
export function normalizeApiBaseUrl(url: string | null | undefined): string {
|
||||
const raw = (url || DEFAULT_API_BASE_URL).trim();
|
||||
return raw.replace(/:\/\/localhost\b/i, "://127.0.0.1");
|
||||
}
|
||||
|
||||
export function loadApiBaseUrl(): string {
|
||||
return normalizeApiBaseUrl(localStorage.getItem("apiBaseUrl"));
|
||||
}
|
||||
|
||||
/** Migra localStorage si el usuario tenía localhost o el puerto antiguo 8000. */
|
||||
export function migrateApiBaseUrlInStorage(): void {
|
||||
const stored = localStorage.getItem("apiBaseUrl");
|
||||
if (!stored) return;
|
||||
let next = normalizeApiBaseUrl(stored);
|
||||
if (next.includes(":8000")) {
|
||||
next = next.replace(":8000", ":8189");
|
||||
}
|
||||
if (next !== stored) {
|
||||
localStorage.setItem("apiBaseUrl", next);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user