Search Forms Driven by URL Search Params
Drive a search form from URL search params: submit a GET form, read the searchParams prop on the server, and render shareable results.
Full-stack React framework
Drive a search form from URL search params: submit a GET form, read the searchParams prop on the server, and render shareable results.
How route.js files turn folders in the App Router into API endpoints, which HTTP methods they support, and how the file path becomes the URL.
How each HTTP method maps to a named export in a Next.js route handler, and what to return for reads, creates, updates, and deletes.
How to read JSON, text, and FormData bodies, parse query parameters, and access headers inside a Next.js route handler.
The response shapes a Next.js route handler can return: JSON with status codes, raw files, streamed content, and redirects.
Read cookies anywhere on the server with the async cookies function, and set or delete them from a Server Action or a Route Handler.
How to build an API endpoint with a dynamic segment, read the route params promise, and type the context object in the App Router.
Return a ReadableStream from a Route Handler, format it as server-sent events, and consume the updates in the browser with EventSource.
Set cross-origin headers on a Route Handler, answer preflight requests with an OPTIONS export, and choose between per-route, proxy, and config-wide approaches.
Build a webhook endpoint as a POST Route Handler, verify the signature against the unchanged body, answer quickly, and handle repeat deliveries.
Identify the caller, count requests in a window, and return a 429 with Retry-After, first in memory and then with a shared store that survives multiple instances.
When to give your Next.js app its own API layer, which tool to reach for, and the mistakes that come from treating Route Handlers as a general backend.