Some tweaks
This commit is contained in:
9
frontend/utils/api.ts
Normal file
9
frontend/utils/api.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user