MCPcopy
hub / github.com/MiniMax-AI/cli / fetch

Function fetch

test/helpers/mock-server.ts:16–37  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

14 const server = Bun.serve({
15 port: 0, // Random available port
16 fetch(req) {
17 const url = new URL(req.url);
18 const path = url.pathname;
19
20 // Try exact match first
21 const handler = opts.routes[path] || opts.routes[`${req.method} ${path}`];
22 if (handler) {
23 return handler(req);
24 }
25
26 // Try prefix match
27 for (const [pattern, handler] of Object.entries(opts.routes)) {
28 if (path.startsWith(pattern)) {
29 return handler(req);
30 }
31 }
32
33 return new Response(JSON.stringify({ error: 'Not found' }), {
34 status: 404,
35 headers: { 'Content-Type': 'application/json' },
36 });
37 },
38 });
39
40 return {

Callers 12

stream.test.tsFile · 0.85
requestFunction · 0.85
toDataUriFunction · 0.85
downloadFileFunction · 0.85
deviceCodeLoginFunction · 0.85
refreshAccessTokenFunction · 0.85
runFunction · 0.85
ghFetchFunction · 0.85
fetchManifestFunction · 0.85
downloadFileFunction · 0.85
fetchLatestVersionFunction · 0.85
probeRegionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected