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

Function getHandler

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

Source from the content-addressed store, hash-verified

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

Callers 1

configureServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected