Axeom Logo
Axeom.

Blueprint Routing

High-precision route definitions.

In Axeom, routes are defined as Blueprints. They aren't just strings; they are the architectural schematic of your application. Axeom uses a high-performance Radix-Tree router that supports static matching, parameters, and wildcards with O(1) complexity.


Basic Schematics

Defining a route follows a standard functional pattern. You can return objects or strings directly, and Axeom will automatically handle the conversion to a standard Web Response.

.("/ping", () => "pong");
.("/data", () => ({ : "accepted" }));
.("/update", () => ({ : "updated" }));
.("/purge", () => ({ : "purged" }));

Path Parameters

Capture dynamic segments using the : prefix. These are automatically extracted and typed in the ctx.params object.

.({
  : new ().()
});

.("/engine/:node_id/status", () => {
  const {  } = .;
  return `Node ${} is active at ${.}`;
});

Grouping & Modularity

Organize your schematics into logical modules using .group(). This allows you to apply prefixes or shared derivations to specific sections of your API.

.("/v1", () => {
  .("/status", () => "v1 kernel active");
  
  .("/metrics", () => ({ : "low" }));
});

Signature Inference

The most powerful aspect of Axeom's routing is that the handler signature is the contract. When you define a route, the input/output types are automatically captured and shared with the client.

.("/users/:id", () => {
  return { : .., : "Axeom User" };
});

// The client instantly knows the return type is { id: string, name: string }
// AND that it requires an 'id' parameter.

Wildcards

Use * to capture any remaining path segments. This is ideal for serving static assets or proxying requests.

.("/logs/*", () => {
  // Access the full request object for custom path handling
  const  = new (..);
  return `Retrieving log fragment from: ${.}`;
});

On this page