Sandpies
docs: interactive demo rebuilt on the real 4.0 editor, plus SandTie PromptRig
3fbd43b
Raw History Blame Contribute Delete
501 Bytes
// Demo stand-in for ComfyUI's api.js. Every request goes to the service worker.
const listeners = {};
export const api = {
clientId: "demo",
apiURL(p) { return p; }, fileURL(p) { return p; },
addEventListener(n, f) { (listeners[n] ||= []).push(f); },
removeEventListener(n, f) { listeners[n] = (listeners[n] || []).filter((x) => x !== f); },
dispatchEvent() {},
async fetchApi(route, opts = {}) { return fetch(route.startsWith("/") ? route : "/" + route, opts); },
};
export default api;