Implement a Simple Static-Site Router
Problem
Given route rules (exact, prefix, wildcard, redirects), match an incoming path to the correct rule with correct precedence.
Input / Output
- Input: a set of route rules and an incoming request path.
- Output: the matched handler, or the redirect target/status for redirect rules.
Constraints
- Precedence: exact > prefix > wildcard
Example
/blog/* -> blog handler; /old -> 301 /new
added …