Skip to main content
Glama
handler.js490 B
// src/adapter/service-worker/handler.ts var handle = (app, opts = { // To use `fetch` on a Service Worker correctly, bind it to `globalThis`. fetch: globalThis.fetch.bind(globalThis) }) => { return (evt) => { evt.respondWith( (async () => { const res = await app.fetch(evt.request, {}, evt); if (opts.fetch && res.status === 404) { return await opts.fetch(evt.request); } return res; })() ); }; }; export { handle };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Valerio357/bet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server