routing
Choosing which piece of code handles a request, based on its method and path, such as GET /users/42.
In more detail
A router matches the path against patterns and extracts parameters such as the 42. Unmatched requests usually receive a 404 Not Found response.
Related terms
- endpoint — An address that a program sends requests to, such as a web path like /health or a network socket.
- API gateway — A server that sits in front of one or more services and handles shared concerns such as routing, authentication, rate limits and TLS for every request.
- hypermedia — Links placed inside representations so clients discover related resources and available actions instead of building addresses themselves.
- route constraint — A rule inside a route template, such as :int in {id:int}, that a URL segment must satisfy for the route to match.
- attribute routing — Declaring a controller's routes with attributes such as [Route("api/products")] and [HttpGet("{id:int}")] on the class and its actions.
- minimal API — An ASP.NET Core style that declares each route and its handler together, as in app.MapGet("/api/ping", () => Results.Ok("catalog")).
- 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.
- middleware — Code that sits between an incoming request and the handler that answers it, doing a shared job such as logging, authentication or rate limiting.
- WHATWG URL Standard — The web standard for parsing URLs, implemented by the global URL class in browsers and Node.js.
Taught in
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Unit And Integration Testing — Modern API Architecture: REST, GraphQL & gRPC
- API Gateways And Proxies — Modern API Architecture: REST, GraphQL & gRPC
- What is .NET? Runtime vs SDK, and LTS vs STS — Modern .NET Core, C# & Enterprise Microservices
- The ASP.NET Core Middleware Pipeline — Modern .NET Core, C# & Enterprise Microservices
- Building Routes with Controllers — Modern .NET Core, C# & Enterprise Microservices
- Comparing Controllers and Minimal APIs — Modern .NET Core, C# & Enterprise Microservices
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices
- Routing & Middleware: Path Parsing & Async Context — Node.js Internals & Backend Services