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

Function configureServer

packages/hosts/mcp-apps-shell/src/vite.ts:355–370  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

353 return `export const shellHtmlUrl = ${JSON.stringify(url)};\nexport default shellHtmlUrl;\n`;
354 },
355 configureServer(server) {
356 // Dev has no emitted assets directory, so the document is served straight
357 // from memory at the same URL the virtual module advertises.
358 server.middlewares.use("/assets", (req, res, next) => {
359 const url = (req as { url?: string }).url ?? "";
360 if (!url.startsWith("/executor-mcp-apps-shell-")) {
361 next();
362 return;
363 }
364 void load().then(({ html }) => {
365 res.setHeader("content-type", "text/html; charset=utf-8");
366 res.setHeader("cache-control", "no-store");
367 res.end(html);
368 });
369 });
370 },
371 async generateBundle(_options, _bundle, _isWrite) {
372 if (command !== "build") return;
373

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
loadFunction · 0.70
nextFunction · 0.50

Tested by

no test coverage detected