Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/src/components/results/results-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"
import { toast } from "sonner"
import { PATH_PREFIX } from "@/lib/api"
import { AppHeader } from "@/components/app-header"
import { Button } from "@/components/ui/button"
import {
Expand Down Expand Up @@ -197,7 +198,7 @@ export function ResultsHeader({
}: ResultsHeaderProps) {
const isMobile = useMediaQuery("(max-width: 768px)")
const statusError = error || job?.error || null
const sharePath = jobId ? `/results?job_id=${jobId}` : ""
const sharePath = jobId ? `${PATH_PREFIX}/results?job_id=${jobId}` : ""
const isSharePublic = !isAuthEnabled || Boolean(job?.public)

const handleCopyLink = () => {
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const API_BASE = (() => {
// Runtime detection for reverse proxy setups (e.g., /evmbench)
if (
typeof window !== "undefined" &&
window.location.pathname.startsWith("/evmbench")
) {
return "/evmbench/api"
}
return process.env.NEXT_PUBLIC_API_BASE ?? "http://127.0.0.1:1337"
})()
// Runtime detection for reverse proxy setups (e.g., /evmbench)
export const PATH_PREFIX =
typeof window !== "undefined" &&
window.location.pathname.startsWith("/evmbench")
? "/evmbench"
: ""

export const API_BASE = PATH_PREFIX
? `${PATH_PREFIX}/api`
: (process.env.NEXT_PUBLIC_API_BASE ?? "http://127.0.0.1:1337")