fix: use runtime BACKEND_URL for proxying (#411)

* fix: use runtime BACKEND_URL for proxying

Fixes #400

* chore: run formatter
This commit is contained in:
Abhishek 2026-06-03 18:47:04 +05:30 committed by GitHub
parent acc2ef9e96
commit cdb27c1d4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 130 additions and 17 deletions

View file

@ -1,5 +1,7 @@
import "server-only";
import { getServerBackendUrl } from "@/lib/apiClient";
let cachedAuthProvider: string | null = null;
/**
@ -12,7 +14,7 @@ export async function getAuthProvider(): Promise<string> {
}
try {
const backendUrl = process.env.BACKEND_URL || "http://localhost:8000";
const backendUrl = getServerBackendUrl();
const res = await fetch(`${backendUrl}/api/v1/health`, {
next: { revalidate: 300 },
});