File-system-based routing makes filesystem paths determine externally accessible routes. A route manifest can therefore begin with the directory tree rather than a centralized configuration file. section 8.2
In Cal.com, each TypeScript file under apps/api/v1/pages/api/ defines a REST endpoint, while its directory determines the URL path. The public REST routes coexist with tRPC routers that consolidate feature procedures. section 8.2
Read the route tree as both an API map and a record of architectural decisions:
- Use ls or the file tree to locate filesystem routes and estimate the API surface. section 8.2
- Treat sibling resource files as separate procedures, versioned directories as compatibility history, and parallel transports as distinct client channels. section 8.2
Figure 8.4 Four routing styles, and the effort required to map the full API for each. Filesystem routes are visible with ls; an aggregator file lists all routes in one place; decorator-scattered routes require scanning every handler; and a schema file defines the entire surface, one typed line per operation.

Compare filesystem routes with aggregator, decorator-scattered, and schema-defined routing by the effort required to map the full API. section 8.2


