feat: Mejorar configuración de Nginx para manejar rutas de API y autenticación, y ajustar la lógica de URLs en el cliente

This commit is contained in:
2026-03-31 11:32:16 -03:00
parent 2d54d6abfc
commit d331381efd
3 changed files with 147 additions and 13 deletions
+4 -1
View File
@@ -1,10 +1,13 @@
const getApiBaseUrl = (defaultPort: string, envVar?: string) => {
if (envVar && envVar.trim() !== '') {
return envVar;
}
if (typeof window !== 'undefined') {
const hostname = window.location.hostname;
const protocol = window.location.protocol;
return `${protocol}//${hostname}:${defaultPort}`;
}
return envVar || `http://localhost:${defaultPort}`;
return `http://localhost:${defaultPort}`;
};
export const getLmsApiUrl = () => getApiBaseUrl("3002", process.env.NEXT_PUBLIC_LMS_API_URL);