Documentation

Routing

Browse documentation

Read this page as HTML, Markdown, or structured JSON—or open the published Markdown with an AI assistant. Gemini receives the prompt through your clipboard because its signed-out page does not reliably prefill URL text; paste when the new tab opens. External assistants need the public site URL.

Routing

The Amber router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.

Pipelines

A pipeline is a set of of transformations that is performed on an HTTP request. These transformations come in the form of a pipe. A pipe is a _**_class which includes HTTP::Handler and implements the #call method. You can think of a pipe as a form of middleware that intercepts any incoming request and modifies the response. Some example usages for pipes are request throttling, ip-based whitelisting, adding custom headers.

Continue reading: pipelines

Routes

Routing in Amber provides developers a manifest to map application URLs to controller actions. By defining routes, you can separate how your application directs requests and how URLs are structured. Each route creates a real-time web socket handler, and define a series of pipeline transformations for scoping middleware to sets of routes.

Continue reading: routes