Introduction
API routes let your app send or get data without showing a new page. They act like helpers that give data when asked.
When you want to get user info without reloading the page.
When your app needs to save form data to a database.
When you want to fetch a list of items to show in a list.
When you need to update part of the page based on user actions.
When you want to keep your data logic separate from your page layout.