Setu-TS
    Preparing search index...

    Function CloudflarePlugin

    • Creates the Cloudflare Workers plugin.

      The Worker's env is passed in rather than imported, because cloudflare:workers is not a specifier any other runtime can resolve. The plugin captures the bindings at register() and never calls a method on one there: Cloudflare prohibits I/O outside a request context, so a probe read at startup would throw on a real deployment while passing against every fake.

      Parameters

      Returns IPlugin

      The plugin instance

      import { env, waitUntil } from 'cloudflare:workers';
      import { CloudflarePlugin } from '@setu-ts/cloudflare-plugin';

      const app = createApplication({
      plugins: [
      RuntimePlugin({ env }),
      CloudflarePlugin({
      env,
      waitUntil,
      cache: { binding: 'CACHE_KV', prefix: 'cache:' },
      }),
      ],
      });

      export default { fetch: app.fetch };

      At register(), when a required or configured binding is absent, or is present with the wrong shape

      0.2.0