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
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace"
const nextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite"],
allowedDevOrigins: ["10.0.0.122", "localhost"],
turbopack: {
root: tracingRoot
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,21 @@ export default function ComboDetailPage() {
return out;
}

const [baseUrl, setBaseUrl] = useState("");
useEffect(() => {
if (typeof window !== "undefined") {
setBaseUrl(window.location.origin);
}
}, []);

if (loading) return <div className="text-text-muted text-sm">Loading...</div>;
if (!combo) return notFound();

const kindLabel = KIND_LABELS[combo.kind] || MEDIA_PROVIDER_KINDS.find((k) => k.id === combo.kind)?.label || "Combo";
const examplePath = EXAMPLE_PATHS[combo.kind];
const exampleBody = combo.kind && EXAMPLE_BODIES[combo.kind] ? EXAMPLE_BODIES[combo.kind](combo.name) : null;
const curlExample = examplePath
? `curl -X POST http://127.0.0.1:20128${examplePath} \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer ${apiKey || "YOUR_KEY"}" \\\n -d '${JSON.stringify(exampleBody)}'`
? `curl -X POST ${baseUrl || 'http://127.0.0.1:20128'}${examplePath} \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer ${apiKey || "YOUR_KEY"}" \\\n -d '${JSON.stringify(exampleBody)}'`
: "";
const backHref = getListingHref(combo.kind);

Expand Down
Loading