Routing

Resuma Flow discovers routes from files under your pages directory — no manual route tables.

File conventions

index.rs           → /
about.rs           → /about
blog/index.rs      → /blog
users/[id].rs      → /users/:id
blog/[...slug].rs  → /blog/*slug
_layout.rs         → layout marker (not a route)

Dynamic segments

Single-bracket [id] captures one path segment. Rest-bracket [...slug] captures the remainder.

src/pages/
├── users/
│   └── [id].rs        → /users/:id
└── docs/
    └── [...slug].rs   → /docs/*slug

Access params in pages

pub fn page(req: FlowRequest) -> View {
    let id = req.param("id").unwrap_or("?");
    view! {
        <h1>"User " {id.to_string()}</h1>
    }
}

Generate registry

resuma routes --generate --path src/pages

Inspect routes

resuma routes --path src/pages