Summary
Add a Fibonacci generator at app/api/routes-f/fibonacci/route.ts. Generate the sequence up to N terms or up to a max value.
Requirements
- POST body { mode: count|until, n?: number, max?: number, format?: array|nth }
- count mode: first n Fibonacci numbers
- until mode: all Fibonacci numbers <= max
- format nth returns just the nth value (with closed-form Binet formula for small n, BigInt iteration for large)
- Use BigInt for n > 78 (where number precision fails)
- Validate n in [1, 10000], max positive
- Return as strings to preserve precision
- Tests: known values, BigInt boundary, both modes
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.
Summary
Add a Fibonacci generator at app/api/routes-f/fibonacci/route.ts. Generate the sequence up to N terms or up to a max value.
Requirements
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.