path parameter
A value embedded in the path of a URL, such as 42 in /users/42, which a router extracts by matching a pattern.
In more detail
Path parameters usually identify a resource, while query parameters filter or modify the request. Frameworks usually write them as :id in a route pattern, as in /users/:id.
Related terms
- matcher (middleware) — The config.matcher option exported from middleware.ts that lists which paths the middleware runs on.
- dynamic route — A route whose folder name is in square brackets, such as [slug], so one page file serves many URLs.
- routing — Choosing which piece of code handles a request, based on its method and path, such as GET /users/42.
- query string — The part of a web address after the question mark, made of name=value pairs, such as ?state=open&limit=2.
Taught in
- Edge Middleware: Auth Verification & Route Matchers — Next.js 15 & Modern App Router Architecture
- Routing & Middleware: Path Parsing & Async Context — Node.js Internals & Backend Services