feat: update save-demo

This commit is contained in:
Henry Li
2026-01-24 18:33:30 +08:00
parent 584c88f0dd
commit 6f24a71e1e

View File

@@ -4,11 +4,14 @@ import path from "path";
import { env } from "process";
export async function main() {
const threadId = process.argv[2];
const url = new URL(
`http://localhost:2026/api/langgraph/threads/${threadId}/history`,
const url = new URL(process.argv[2]);
const threadId = url.pathname.split("/").pop();
const host = url.host;
const apiURL = new URL(
`/api/langgraph/threads/${threadId}/history`,
`${url.protocol}//${host}`,
);
const response = await fetch(url, {
const response = await fetch(apiURL, {
method: "POST",
headers: {
"Content-Type": "application/json",