MCPcopy Create free account
hub / github.com/error311/FileRise / apiGet

Function apiGet

public/js/aiChat.js:36–47  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

34}
35
36async function apiGet(path) {
37 const resp = await fetch(withBase(path), {
38 method: 'GET',
39 credentials: 'include',
40 headers: { Accept: 'application/json' }
41 });
42 const body = await safeJson(resp);
43 if (!resp.ok || !body || body.ok === false) {
44 throw new Error((body && (body.error || body.message || body.assistant)) || `HTTP ${resp.status}`);
45 }
46 return body;
47}
48
49async function apiPost(path, payload) {
50 const resp = await fetch(withBase(path), {

Callers 3

loadRecipesFunction · 0.70
pollFunction · 0.70
initAiChatFunction · 0.70

Calls 2

withBaseFunction · 0.85
safeJsonFunction · 0.70

Tested by

no test coverage detected