Expand description
The routes as a tower Service, for hyper, axum, and most Rust HTTP stacks (node.ts’s adapter,
for Rust): the request read into a runlight::http::Request, with its body capped, and the answer
written back as an http::Response.
Modules§
- axum_
support - axum: the routes mounted at their base path and the short links at their link path, as one
Routerto merge into the app’s. A router only sees the paths it routes, so link domains, whose short links sit at the root of their own name, and AI agent fetches go throughmiddleware, which runs before the app’s own routes.
Structs§
- Link
Service - Short links on the app’s own domain,
{link_path}/{slug}, as a towerService. It is what the app routes its link path to, so it answers every request it is handed: a link domain’s first (where the link path is a path with no link, a 404), then the link’s redirect, or Runlight’s own 404 for a slug with no link. A router has already matched the path by then and cannot hand it on to the app’s fallback, so the app’s own 404 page does not show there.
Functions§
- to_http
- Runlight’s answer as an
http::Response. - to_
request - An
http::Requestas Runlight’s, its body read whole up to the cap.Erris the answer when the body is too large.