Next.js Hybrid App
Create a hybrid app that mixes App Router, Pages Router, and API routes with explicit routing boundaries.
When to Use
- •Migrating from Pages Router to App Router
- •Keeping legacy routes while adding new App Router features
- •Incremental migration with minimal risk
Inputs
- •Existing routes and new routes
- •API surface to keep or move
- •Route collision risks
Instructions
- •Keep legacy routes in
pages/. - •Add new routes in
app/. - •Avoid route collisions and duplicate paths.
- •Prefer
app/apiRoute Handlers for new APIs. - •Document migration order and deprecations.
Output
- •Hybrid routing plan and updated route structure.