Routing

Standalone module for testing and benchmarking routing logic

routing.kz

Orisha Router - Pattern-matching HTTP router Standalone module for testing and benchmarking routing logic without network overhead. Usage: ~test(Route matching) { ~router.match = ok { path: "/users/42", pattern: "/users/:id" } ~router.match(path: "/users/42", pattern: "/users/:id") | ok m |> assert.ok() }
// ============================================================================
// PATTERN MATCHING
// ============================================================================
// 
// Match a path against a pattern like "/users/:id/posts/:post_id"
// Returns match result with extracted parameters
~pub event match {
    path: []const u8, pattern: []const u8
}
| ok { result: RouteMatch }
| no_match {}