diff --git a/src/app/auth/login/page.tsx b/src/app/auth/login/page.tsx index 0b946b5..722721b 100644 --- a/src/app/auth/login/page.tsx +++ b/src/app/auth/login/page.tsx @@ -16,7 +16,8 @@ export default function LoginPage() { setIsLoading(true); try { - const res = await fetch("http://localhost:5000/api/auth/login", { + const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:5000"; + const res = await fetch(`${apiUrl}/api/auth/login`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formData), diff --git a/src/app/auth/signup/page.tsx b/src/app/auth/signup/page.tsx index 06b8bd2..d388213 100644 --- a/src/app/auth/signup/page.tsx +++ b/src/app/auth/signup/page.tsx @@ -16,7 +16,8 @@ export default function SignupPage() { setIsLoading(true); try { - const res = await fetch("http://localhost:5000/api/auth/signup", { + const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:5000"; + const res = await fetch(`${apiUrl}/api/auth/signup`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formData),