MCPcopy Create free account
hub / github.com/hashintel/hash / jsonResponse

Function jsonResponse

apps/petrinaut-website/api/chat.ts:41–45  ·  view source on GitHub ↗
(body: unknown, init: ResponseInit = {})

Source from the content-addressed store, hash-verified

39const rateLimitBuckets = new Map<string, { count: number; resetAt: number }>();
40
41const jsonResponse = (body: unknown, init: ResponseInit = {}) => {
42 const headers = new Headers(init.headers);
43 headers.set("content-type", "application/json");
44 return new Response(JSON.stringify(body), { ...init, headers });
45};
46
47const logChatFailure = (
48 reason: string,

Callers 1

fetchFunction · 0.70

Calls 1

setMethod · 0.45

Tested by

no test coverage detected