What Is a Route Handler?
A route handler is a function tied to a specific URL and HTTP method that runs on the server to handle a request and produce a response. It is how modern app frameworks expose API endpoints alongside page routes. The handler can read the request, talk to data sources, and return JSON or other content.
Why it matters
Route handlers let an application serve both pages and APIs from one codebase and deployment. Keeping them small and well-scoped makes the request surface easy to reason about.
Related guides
What Is Web Middleware?Web middleware is code that runs before a request reaches a route handler, letting it rewrite, redirect, auth…
What Is a Server Action?A server action is a server-side function a client can invoke directly to mutate data, letting forms run back…
What Is a Data Mutation?A data mutation is an operation that creates, updates, or deletes server state, unlike a read, and usually re…