Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...
    Documentation
    GitHub

    Integrate

    Cloudflare Pages Functions

    A function takes a context with the request and a next that runs the next function or the static asset server.

    import { spool } from './spool';

    export const onRequest = (context: { request: Request; next(): Promise<Response> }) =>
    spool.handle(context.request, () => context.next());

    examples/courses/cloudflare-pages/ runs this shape. Build the site, then run npx wrangler pages dev <build directory> in a Pages project.