MCPcopy
hub / github.com/garrytan/gstack / fetch

Function fetch

browse/test/browse-client.test.ts:36–48  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

34 const server = Bun.serve({
35 port: 0, // random port
36 async fetch(req) {
37 const body = await req.text();
38 let parsed: any = body;
39 try { parsed = JSON.parse(body); } catch { /* leave as text */ }
40 requests.push({
41 method: req.method,
42 url: new URL(req.url).pathname,
43 authorization: req.headers.get('Authorization'),
44 contentType: req.headers.get('Content-Type'),
45 body: parsed,
46 });
47 return new Response(response.body, { status: response.status });
48 },
49 });
50
51 return {

Callers

nothing calls this directly

Calls 3

textMethod · 0.45
pushMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected