feat: add help view
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 1m20s

This commit is contained in:
2024-04-26 15:30:52 +02:00
parent d06b33f508
commit cafe9bff84
16 changed files with 256 additions and 87 deletions

View File

@@ -0,0 +1,29 @@
import type { RequestHandler } from "./$types";
import { MemoryRuntimeExecutor } from "$lib/runtime-executor";
import { RemoteNodeRegistry } from "$lib/node-registry-client";
import { createPerformanceStore } from "$lib/performance";
const registry = new RemoteNodeRegistry("");
const runtime = new MemoryRuntimeExecutor(registry);
const performanceStore = createPerformanceStore();
runtime.perf = performanceStore;
export const POST: RequestHandler = async ({ request, fetch }) => {
const { graph, settings } = await request.json();
registry.fetch = fetch;
await registry.load(graph.nodes.map(node => node.type))
const res = await runtime.execute(graph, settings);
let headers: Record<string, string> = { "Content-Type": "application/octet-stream" };
if (runtime.perf) {
headers["performance"] = JSON.stringify(runtime.perf.get());
}
return new Response(res, { headers });
}