MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / getHandler

Function getHandler

apps/host-selfhost/vite.config.ts:50–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48function executorApiPlugin(): Plugin {
49 let handlerPromise: Promise<{ handler: (request: Request) => Promise<Response> }> | null = null;
50 const getHandler = async () => {
51 if (!handlerPromise) {
52 // Computed specifier so Vite's Node-based config loader does NOT statically
53 // follow this into ./src/api/api (which imports @executor-js/host-mcp, whose
54 // extensionless re-exports resolve under Bun but not Node ESM). It only runs
55 // at dev-server request time, under `bunx --bun vite dev`.
56 const apiModule = new URL("./src/api/api.ts", import.meta.url).href;
57 handlerPromise = import(apiModule).then((m) => m.makeSelfHostApiHandler());
58 }
59 return handlerPromise;
60 };
61
62 return {
63 name: "executor-selfhost-api",

Callers 1

configureServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected