Nested Routes
Nested routes are created by folder depth under your apiDir: each folder adds a segment to the URL. Combine static segments, dynamic segments, and route groups to build nested paths.
Example
api/users/route.ts→/api/usersapi/users/[id]/route.ts→/api/users/:idapi/users/[id]/posts/route.ts→/api/users/:id/posts
For static and dynamic behavior, see Static Routes, Dynamic Routes, and Route Groups.