MCPcopy Create free account
hub / github.com/MemTensor/MemOS / serveStatic

Function serveStatic

apps/memos-local-plugin/server/middleware/static.ts:41–49  ·  view source on GitHub ↗
(
  res: ServerResponse,
  pathname: string,
  opts: ServerOptions,
)

Source from the content-addressed store, hash-verified

39};
40
41export async function serveStatic(
42 res: ServerResponse,
43 pathname: string,
44 opts: ServerOptions,
45): Promise<boolean> {
46 if (!opts.staticRoot) return false;
47 const relative = pathname === "/" || pathname === "/viewer" ? "/index.html" : pathname;
48 return await tryServe(res, opts.staticRoot, relative);
49}
50
51async function tryServe(
52 res: ServerResponse,

Callers 1

dispatchFunction · 0.85

Calls 1

tryServeFunction · 0.85

Tested by

no test coverage detected