Skip to content

FlareAppCF

class FlareAppCF extends FlareAppBase<"sync">

Compiled Cloudflare application returned by host.build(), exposing the export terminal.

  • export: the Worker fetch handler (the module default export).

Handed to you by the framework; see Deploy.

host: IFlareHost<"sync">
http: HttpArc<"sync">
export(): WorkerExportedHandle

Starts the shared graph and returns the Worker fetch handler, seeded with the isolate env on first request.

returns WorkerExportedHandle

test(_opts?: AppTestOptions): Promise<TestAppHandle>

Starts the application in test mode and returns a TestAppHandle for driving synthetic requests. Mirrors how run() (Node) returns a NodeRunHandle and export() (CF) returns a { fetch } handle.

The base implementation throws when FLARE_MODE=test was not set, so host.build() returned a production app rather than the test variant. Set FLARE_MODE=test before importing the host module (vitest: test.env.FLARE_MODE = 'test'). FlareTestApp overrides with the real implementation.

_opts? AppTestOptions

returns Promise<TestAppHandle>

Learn: Deploy

Last updated: