Fix analyze page backendUrl reference for Next.js build
Browse files46 unmodified lines474849505152505152535413 unmodified lines68697072737475767778797172737413 unmodified lines8889909991929346 unmodified lines try { const formData = new FormData(); formData.append("video", videoFile); const base = backendUrl || ""; // empty means same origin // Request 20 frames to match preprocessing const url = `${base}/api/infer?frame_rate=5&max_frames=20`; // Request 20 frames to match preprocessing, using same-origin backend const url = "/api/infer?frame_rate=5&max_frames=20"; const res = await fetch(url, { method: "POST", body: formData }); if (!res.ok) { const text = await res.text();13 unmodified lines <header className="bg-slate-950 border-b border-emerald-900"> <div className="max-w-7xl mx-auto px-4 py-4 flex items-center justify-between"> <h1 className="text-xl font-semibold">Analyze a Video</h1> <div className="flex items-center gap-3"> <label className="text-sm">Backend URL</label> <input className="border rounded px-2 py-1 text-sm bg-white dark:bg-gray-800 dark:border-gray-700" value={backendUrl} /> const url = `/api/infer?frame_rate=5&max_frames=20`; </div> <div className="flex items-center gap-3" /> </div> </header>
13 unmodified lines className="hidden" onChange={onFileChange} /> <div className="flex items-center gap-3" /> {videoFile && ( <div className="w-full"> <div className="flex items-center justify-between mb-2">frontend/pages/analyze.jsx+3-12