MCPcopy Create free account
hub / github.com/Sandpack/nodebox-runtime / dependencyQueryMiddleware

Method dependencyQueryMiddleware

tests/setup/MockCdn.ts:40–51  ·  view source on GitHub ↗
(req: FastifyRequest, res: FastifyReply)

Source from the content-addressed store, hash-verified

38 }
39
40 private dependencyQueryMiddleware(req: FastifyRequest, res: FastifyReply): void {
41 res.header('access-control-allow-origin', '*');
42
43 const responseJson: Record<string, string> = {};
44
45 for (const pkg of this.packages) {
46 const pkgMajorVersion = pkg.version.split('.')[0];
47 responseJson[`${pkg.name}@${pkgMajorVersion}`] = pkg.version;
48 }
49
50 this.respondWith(res, responseJson);
51 }
52
53 private moduleQueryMiddleware(req: FastifyRequest<{ Params: { query: string } }>, res: FastifyReply): void {
54 res.header('access-control-allow-origin', '*');

Callers

nothing calls this directly

Calls 1

respondWithMethod · 0.95

Tested by

no test coverage detected