MCPcopy Index your code
hub / github.com/garrytan/gstack / respond

Function respond

test/skill-e2e-ios.test.ts:152–156  ·  view source on GitHub ↗
(res: import('http').ServerResponse, status: number, body: unknown)

Source from the content-addressed store, hash-verified

150}
151
152function respond(res: import('http').ServerResponse, status: number, body: unknown): void {
153 const payload = JSON.stringify(body);
154 res.writeHead(status, { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload) });
155 res.end(payload);
156}
157
158async function fetchJson(method: string, url: string, init: { headers?: Record<string, string>; body?: string } = {}): Promise<{ status: number; body: unknown }> {
159 const res = await fetch(url, { method, headers: init.headers, body: init.body });

Callers 1

startStubStateServerFunction · 0.85

Calls 1

endMethod · 0.80

Tested by

no test coverage detected