Routing
Routing is the selection of a path, destination, or processing component to direct an item, request, or flow toward an intended endpoint.
Rust Servers, Services, and Apps
A router is a request-dispatching component that selects a handler based on the characteristics of an incoming request.
- How it is used
- Dispatches incoming HTTP requests to handlers in both a hand-built server and Actix Web applications.
- How deep it goes
- Defines the dispatch responsibility and works through route registration, scopes, path parameters, and checks with placeholder handlers.
- Examples
- Uses a GET health check, scoped course endpoints, and curl requests against POST, PUT, and DELETE placeholders.
- What you can do after
- Apply it via Actix Web route configuration and verify that requests reach the intended handlers with curl.
Read how Rust Servers, Services, and Apps explains routing →
ASP.NET Core in Action, 3e
Routing is the mechanism that maps incoming requests to application endpoints or handlers.
- How it is used
- Maps incoming HTTP requests to endpoints while allowing flexible public URLs and values captured from their paths.
- How deep it goes
- Explains endpoint selection and execution, then develops route parameters, constraints, conventions, and URL generation.
- Examples
- Uses a `/person/{name}` minimal API, a file-path-derived Razor Page route, and a default MVC controller route.
- What you can do after
- Build it from scratch with route templates, then generate links and choose between explicit and conventional mappings.
Learn Go with Pocket-Sized Projects
A multiplexer is a web-serving component or library that matches incoming requests to handlers and manages their routing.
- How it is used
- Routes incoming HTTP requests to endpoint handlers in a multi-endpoint service.
- How deep it goes
- Works through mux construction, method-and-path registration, server wiring, and request checks; leaves response construction to handlers.
- Examples
- Uses `POST /games`, GET and POST curl requests, and a `GET /` page route.
- What you can do after
- Build it from scratch with `http.NewServeMux`, register method-and-path handlers, and pass the router to `http.ListenAndServe`.
Read how Learn Go with Pocket-Sized Projects explains routing →
Go in Practice, Second Edition
URL pattern matching is the routing of requests by applying expressive patterns to URL paths rather than only comparing fixed path segments.
- How it is used
- Maps HTTP requests to response handlers using paths, methods, and, where needed, path variables.
- How deep it goes
- Works through handler registration, method patterns, path extraction, nested multiplexers, and a custom regex alternative without requiring a framework.
- Examples
- Uses GET and POST comment handlers, an individual-comment path variable, and nested user and comment routers.
- What you can do after
- Build it from scratch with net/http handler patterns and PathValue, or extend routing with nested multiplexers.
Pro ASP.NET Core 7, Tenth Edition
Router is a Blazor component that discovers routable components in an assembly and renders the component matching the current URL.
- How it is used
- Selects Razor components as the URL changes, allowing multiple components to appear through a single request.
- How deep it goes
- Works through assembly configuration, Found and NotFound fragments, and the RouteView handoff; stops short of route-matching internals.
- Examples
- Configures Routed.razor with the current assembly, a RouteView for matches, and a visible unmatched-route message.
- What you can do after
- Build it from scratch with Router, RouteView, AppAssembly, Found, NotFound, and @page to select components by URL.
Read how Pro ASP.NET Core 7, Tenth Edition explains routing →
Pro Angular 16
Router is the Angular service that performs programmatic navigation among application routes.
- How it is used
- Uses browser URLs to select displayed components and Router to initiate navigation from component or directive code.
- How deep it goes
- Works through route setup, template and code navigation, matching behavior, and troubleshooting; extends to child and dynamically loaded routes.
- Examples
- Uses store-to-cart navigation and a product form that returns to a table after submission.
- What you can do after
- Apply it via Angular Router to navigate after component actions and via routerLink for template-driven navigation.
AI Agents and Applications
A router function is a callable that examines workflow conditions and returns the name of the next execution path.
- How it is used
- Directs a request to a suitable retriever or specialist agent within a workflow.
- How deep it goes
- Builds typed LLM decisions, retriever selection, and LangGraph handoffs; also shows a rule-based conditional edge.
- Examples
- Tests tourist-information and accommodation questions, then traces a travel request through a router-based agent graph.
- What you can do after
- Build it from scratch: classify a request and dispatch it to a named retriever chain or LangGraph agent node.
AI Agents in Action, Second Edition
Model routing is selecting and dispatching a request to a model or agent based on the request's characteristics and required task complexity.
- How it is used
- Dispatches requests to suitable models or specialized agents according to intent and task needs.
- How deep it goes
- Defines branching and gives selection, measurement, and failure guidance without implementing a router.
- Examples
- Uses technical-versus-billing specialists and a RAG triage–retriever–answerer workflow to illustrate branches.
- What you can do after
- Evaluate/understand when routing warrants its overhead and how wrong routes affect quality and cost.
Read how AI Agents in Action, Second Edition explains routing →
React in Depth
A route is a configured application endpoint or location that maps incoming requests to a handler or interface output.
- How it is used
- Maps URLs to React pages, route-specific data, and API responses in website frameworks.
- How deep it goes
- Works through fixed and parameterized file conventions, server-side data handoffs, and API handlers; does not detail routing internals.
- Examples
- Uses country and city URLs, shop-category data routes, and a coordinate-to-city geocoding API.
- What you can do after
- Apply it via Next.js pages routing or Remix to create dynamic pages with server-loaded data and API endpoints.
Google Anthos in Action
Traffic routing is the directed selection of destinations for network requests according to routing rules or release-management criteria.
- How it is used
- Supports controlled microservice releases, version selection, A/B testing, and progressive delivery.
- How deep it goes
- Explains percentage- and rule-based routing with release examples, but defers detailed routing configuration syntax.
- Examples
- Uses Istio canary traffic splitting, user-agent selection, and Knative 95/5 revision routing.
- What you can do after
- Apply it via Istio or Knative to shift traffic gradually between service revisions without application-code changes.
Build a Frontend Web Framework (From Scratch)
A client-side application component that maps URLs to views or components and manages navigation without a full page reload.
- How it is used
- Coordinates URL changes, component selection, and view updates in single-page applications.
- How deep it goes
- Traces SPA loading, mounting, navigation, and SSR route rendering, but stops short of implementing a complete router.
- Examples
- Uses SPA route navigation, dynamic mounting, SSR-rendered pages, and hydration as concrete examples.
- What you can do after
- Evaluate how SPA and SSR applications respond when users navigate between routes.
Read how Build a Frontend Web Framework (From Scratch) explains routing →
Building Reliable AI Systems
The technique of directing different queries or tasks to selected models according to their requirements or cost.
- How it is used
- Matches queries to models by complexity and directs ambiguous requests toward appropriate agents.
- How deep it goes
- Works through keyword and query-length rules, a function-calling classifier, and tests for ambiguous decisions.
- Examples
- Uses store-hours and specialized queries, keyword-and-length Python checks, and vague shopping and returns questions.
- What you can do after
- Build it from scratch with simple rules, then test whether unclear requests reach useful destinations.
Learn Docker in a Month of Lunches, Second Edition
A Traefik router is a routing rule that matches an incoming request and selects a target service.
- How it is used
- Routes external HTTP traffic from container entrypoints to application services through hostname and path rules.
- How deep it goes
- Explains the router-to-service mapping and label configuration, then verifies it with dashboard inspection and curl.
- Examples
- Uses the whoami application, hostname labels, a Traefik dashboard, curl checks, and scaled containers.
- What you can do after
- Apply it via Docker Compose and Traefik labels, then verify hostname routing and upstream responses with curl.
Read how Learn Docker in a Month of Lunches, Second Edition explains routing →
The Well-Grounded Python Developer: How the pros use Python and Flask
A URL route is a web-framework mapping from a URL pattern or path to application code that handles requests for it.
- How it is used
- Connects browser-accessible URL paths to Python functions that process HTTP requests and produce responses.
- How deep it goes
- Defines decorator-based registration, request handling, and additional routes, while deferring broader application routing details.
- Examples
- Uses a Flask root route returning Hello World and a template-backed route rendering the current time.
- What you can do after
- Build it from scratch by registering Flask routes, serving responses, adding endpoints, and passing dynamic data to templates.
Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains routing →
Build an AI Agent (From Scratch)
A router agent is an AI agent that examines a request and transfers control to an appropriate specialist agent.
- How it is used
- Selects specialists according to a request instead of always running a fixed sequence.
- How deep it goes
- Traces handoffs through transfer state, agent-tree relationships, target selection, and validation; does not show the complete run method.
- Examples
- Uses billing and support handlers, research and code-execution requests, and a router with math and search specialists.
- What you can do after
- Build it from scratch by registering specialists, tracking transfer state, and restricting handoffs through an agent tree.
Read how Build an AI Agent (From Scratch) explains routing →
.NET in Action, Second Edition
A route is a URL pattern that an HTTP request can match to select an endpoint handler.
- How it is used
- Maps HTTP requests to response-producing handlers in a web service.
- How deep it goes
- Explains root and parameterized routes, including name matching, type conversion, and request failure when binding does not match.
- Examples
- Uses `/` for a greeting and `/{text}` to render URL text as ASCII art, with an optional font query parameter.
- What you can do after
- Apply routing through ASP.NET Core `MapGet` to return a greeting or render a path parameter as ASCII art.
Transformers in Action
A gating network is a lightweight neural component that scores experts and selects or weights them for each input token.
- How it is used
- Deploys inside transformer feed-forward positions to allocate computation selectively across mixture-of-experts networks.
- How deep it goes
- Explains scoring, top-k selection, softmax weighting, and GShard extensions, but does not detail the complete dispatch computation.
- Examples
- Demonstrates NativeGate top-k routing and GshardGate capacity-aware routing with optional random assignment.
- What you can do after
- Build it from scratch using a linear scorer, top-k selection, and softmax-normalized expert weights.
Learn Haskell by Example
A route is a URL path pattern that identifies an API operation and may contain variable segments.
- How it is used
- Defines Servant API operations by combining paths, HTTP methods, request bodies, captures, and response types.
- How deep it goes
- Encodes multiple typed endpoints and variable segments, but defers detailed explanation of DataKinds and TypeOperators.
- Examples
- Uses simple GET endpoints, JSON responses, POST request bodies, captured identifiers, and a typed todo-list API.
- What you can do after
- Apply routing via Servant by declaring typed paths, composing endpoints, capturing variables, and specifying request and response formats.
Essential TypeScript 5, Third Edition
Router is the Angular service that performs programmatic navigation and manages application URL changes.
- How it is used
- Performs navigation and selects displayed components from the current URL in Angular and React applications.
- How deep it goes
- Shows programmatic and declarative navigation plus route mapping, but does not detail Angular route-configuration internals.
- Examples
- Uses product, order, and summary URLs, including /summary/5, plus Angular and React route configuration examples.
- What you can do after
- Apply Angular Router and routerLink or React Router to navigate between components and redirect default URLs.
Read how Essential TypeScript 5, Third Edition explains routing →
Machine Learning System Design
Routing between models is a pattern that selects among models according to the characteristics or difficulty of each input.
- How it is used
- Uses input difficulty to direct serving requests toward models with appropriate cost and capability.
- How deep it goes
- Distinguishes difficulty-based selection from a two-model latency variation without detailing routing implementation.
- Examples
- Illustrates a fast, imperfect model followed by a slower, more accurate model.
- What you can do after
- Evaluate routing tradeoffs by distinguishing compute savings from faster time to initial response.
Latency
Request routing is the strategy of forwarding incoming requests to the component responsible for processing them.
- How it is used
- Uses request routing to direct partitioned-system traffic toward components with fast access to the required data.
- How deep it goes
- Defines the strategy, explains locality and balancing, and demonstrates implementation, but defers the actual data-partitioning strategy.
- Examples
- Demonstrates node-ID ports, a Rust REST API, round-robin HTTP benchmarking, and one-node versus five-node latency measurements.
- What you can do after
- Apply it via a partition-aware HTTP client that targets configured nodes and measures latency across different node counts.
Financial AI in Practice
Model routing is the process of directing requests to different models according to their characteristics or requirements.
- How it is used
- Reduces generative AI costs by matching requests to model tiers according to task complexity and quality needs.
- How deep it goes
- Defines tier selection by request simplicity, risk, and quality needs but leaves routing logic and implementation unspecified.
- Examples
- Contrasts routing simple, low-risk requests to cheaper models with reserving top-tier models for premium or complex tasks.
- What you can do after
- Apply it via a smart gateway that sends requests to model tiers based on task demands.
Related concepts
- progressive enhancementuses · Progressive enhancement is a development approach that provides broadly compatible baseline functionality and adds capabilities when the environment supports them.
- routing middlewareused by · Routing middleware is an ASP.NET Core request-pipeline component that matches incoming requests to endpoints and stores the selected endpoint for subsequent processing.
- asp-action attributeused by · The asp-action attribute is a Razor tag helper attribute that identifies the action method for which a URL should be generated.
- connected routeincludes · A connected route is a route to a network directly attached to an interface with an IP address that is operationally up.
- RedirectToRouteused by · RedirectToRoute is a method or result that generates a URL from route information and returns a redirect response to that URL.
- handlerused by · A handler is a callable or software component that processes an event, request, message, or other input and performs associated processing.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





















