MCPcopy Create free account
hub / github.com/cppla/ServerStatus / api

Function api

web/js/app.js:589–594  ·  view source on GitHub ↗
(path, options = {})

Source from the content-addressed store, hash-verified

587 return { 'Content-Type': 'application/json', 'Authorization': `Bearer ${S.admin.token}` };
588}
589async function api(path, options = {}){
590 const res = await fetch(path, { ...options, headers: { ...(options.headers || {}), ...(options.auth === false ? {} : adminHeaders()) } });
591 const data = await res.json().catch(() => ({}));
592 if(!res.ok || data.ok === false) throw new Error(data.error || res.statusText);
593 return data;
594}
595async function ensureAdminChecked(){
596 if(S.admin._checking) return;
597 S.admin._checking = true;

Callers 5

ensureAdminCheckedFunction · 0.85
loadConfigFunction · 0.85
saveConfigItemFunction · 0.85
deleteConfigItemFunction · 0.85
bindAdminFunction · 0.85

Calls 1

adminHeadersFunction · 0.85

Tested by

no test coverage detected