[H] Implement Path-to-Route Matching Algorithm
- Langage dominant
- C++
- Étoiles
- 0
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### Issue: Implement Path-to-Route Matching Algorithm
#### Description
Currently, there is no path-to-route matching algorithm implemented. We need to add a matching mechanism similar to framework-based approaches. Possible solutions include:
- Using `path-to-regex` for pattern-based matching.
- Implementing a segment-by-segment route matching strategy.
#### Examples
##### Using `path-to-regex` (Pattern-Based Matching)
- **Route Pattern:** `/users/:id/profile`
- **Incoming Path:** `/users/123/profile`
- **Matched Parameters:** `{ id: "123" }`
- **Route Pattern:** `/products/:category/:id`
- **Incoming Path:** `/products/electronics/42`
- **Matched Parameters:** `{ category: "electronics", id: "42" }`
##### Segment-by-Segment Matching
- **Route:** `/dashboard/settings`
- ✅ Matches `/dashboard/settings`
- ❌ Does **not** match `/dashboard/user/settings`
- **Route with Dynamic Segments:** `/blog/:postId/comments/:commentId`
- ✅ Matches `/blog/456/comments/789`
- ❌ Does **not** match `/blog/comments/789` (missing `postId`)
#### Task List
- [ ] Research and decide on the best approach (`path-to-regex` or segment matching).
- [ ] Implement the path-to-route matching logic.
- [ ] Add unit tests to validate different matching scenarios.
**Labels:** `enhancement` `routing`
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.