Understanding Dynamic Routing and API Routes in Next.js
Instead of creating files for all pages, next.js is a JavaScript-based React framework that allows you to create different routes and work with the query data to dynamically create pages. That’s the phenomenon of dynamic routing in next.js.