mirror of
https://github.com/hanzoai/trace-js.git
synced 2026-10-30 18:19:26 +00:00
30 lines
573 B
TypeScript
30 lines
573 B
TypeScript
import Hanzo from "hanzo";
|
|
|
|
export const runtime = "edge";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(request: Request) {
|
|
const id = crypto.randomUUID();
|
|
|
|
const hanzo = new Hanzo({
|
|
publicKey: "pk-lf-1234567890",
|
|
secretKey: "sk-lf-1234567890",
|
|
baseUrl: "http://localhost:3000",
|
|
flushAt: 1,
|
|
});
|
|
|
|
hanzo.debug();
|
|
|
|
hanzo.trace({
|
|
id,
|
|
name: "example-nextjs-backend-route",
|
|
});
|
|
|
|
await hanzo.shutdownAsync();
|
|
|
|
return new Response(JSON.stringify({ id }), {
|
|
headers: { "content-type": "application/json" },
|
|
});
|
|
}
|