core/extra

🎯 Route Matcher

Interactive playground for Fiber's route matching: edit a route table and a request, see which route wins, why the others lose, and which parameters are extracted.

import RoutePlayground from '@site/src/components/route-playground';

Edit the route table or the request and watch which route wins, why the others lose, and which parameters are extracted. Routes are tried in registration order, exactly like in a real Fiber app:

#MethodPatternResultRemove
1path has an unmatched remainder "users/42"
2static part "/users/new" does not match at "/users/42"
3matches, first match wins
4not tried, an earlier route already matched
5not tried, an earlier route already matched
6not tried, an earlier route already matched
Request:

200 OK

Route 3 answers: GET /users/:id<int>

ParameterValue
id42

Simulates Fiber's matcher with default settings (case-insensitive, non-strict routing). Verified against the real matcher; datetime and custom constraints are not simulated, and regex() runs on the JS engine.

Note

The playground simulates Fiber's matcher with default settings (case-insensitive, non-strict routing). datetime and custom constraints are not simulated, and regex() runs on the JS engine instead of Go's RE2.

The routing guide explains the full syntax: parameters, wildcards, literal separators, and constraints.