Aman16-ai / Aman16-ai/Boggy

[H] Implement Path-to-Route Matching Algorithm

Ouverte
#1 0 commentaires 0 réactions 1 personne assignée Réclamée par @Aman16-ai Voir sur GitHub
enhancement High
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.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.