Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →