Use empty string for API_BASE in production (relative paths)
This commit is contained in:
parent
4630ea3999
commit
5252d471ba
1 changed files with 2 additions and 2 deletions
|
|
@ -86,9 +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"
|
||||||
? (typeof window !== "undefined" && (window as { location?: { hostname?: string } }).location?.hostname === "localhost"
|
? ((window as { location?: { hostname?: string } }).location?.hostname === "localhost"
|
||||||
? "http://localhost:8000"
|
? "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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue