Devflare Docs
Routing recipe Quickstart

Move from one fetch file to without adding binding noise

The first route-tree step should only change project shape: config, request-wide middleware, one route, and one worker-level test.

Do this before adding storage or remote services. It teaches the authored file shape and the route dispatch contract while the app is still small enough to debug by sight.

Best for
The first growth step after
Files
, , ,
Proof
exercises route dispatch

Copy the route tree shape

Worker-only route tree with one test

These files are enough to move out of a single fetch handler while keeping the runtime and test story honest.

Common failure messages

SymptomLikely fix
for a route fileCheck , the route filename, and any configured prefix.
Ambiguous two-argument handler errorWrap the handler with or use an event-first signature.
is not a functionImport from in tests, not from .

Previous

Your first unit test

Take the same starter worker from the previous page and add one request test through so the first check uses the same runtime shape the worker will actually run.

Next

Your first bindings

Take the same starter worker, split it into routes and helpers, then add one binding-backed route at a time so can stay small.