Some tweaks

This commit is contained in:
cdricms
2026-03-21 11:53:25 +01:00
parent 4cf85981eb
commit 83eddf89cd
5 changed files with 22 additions and 32 deletions

9
frontend/utils/api.ts Normal file
View File

@@ -0,0 +1,9 @@
export const getApiUrl = () => {
// If window is undefined, we are running on the server (SSR in Docker)
if (typeof window === "undefined") {
return process.env.INTERNAL_API_URL || "http://latosa-backend:4001";
}
// Otherwise, we are running in the user's browser
return process.env.NEXT_PUBLIC_API_URL;
};