Fix API_BASE to use relative path for production
Some checks are pending
CI / Engine — lint / typecheck / test (push) Waiting to run
CI / API — lint / typecheck / test (push) Waiting to run
CI / Web — typecheck / lint / build (push) Waiting to run

This commit is contained in:
Manohar Gupta 2026-05-24 00:32:41 +05:30
parent 0f8a50caf2
commit 4630ea3999

View file

@ -86,7 +86,9 @@ export function ProfileViewer() {
const [isLoadingFile, setIsLoadingFile] = useState(false); const [isLoadingFile, setIsLoadingFile] = useState(false);
const API_BASE = typeof window !== "undefined" const API_BASE = typeof window !== "undefined"
? ((window as unknown as { NEXT_PUBLIC_API_URL?: string }).NEXT_PUBLIC_API_URL || "http://localhost:8000") ? (typeof window !== "undefined" && (window as { location?: { hostname?: string } }).location?.hostname === "localhost"
? "http://localhost:8000"
: (window as { env?: { NEXT_PUBLIC_API_URL?: string } }).env?.NEXT_PUBLIC_API_URL || "/")
: "http://localhost:8000"; : "http://localhost:8000";
async function fetchAndDisplayFile(path: string, name: string) { async function fetchAndDisplayFile(path: string, name: string) {