Route Matching Issues
Symptoms
- 404 errors when a route should exist
- Wrong response returned for a request
- Path parameters not being captured
How Route Matching Works
Routes are matched in this priority order:
- Exact match - Static paths match first
- Parameterized match -
:paramsegments match next - Wildcard match -
*catches remaining paths
Common Issues
Path Parameter Conflicts
GET /users/me (static)
GET /users/:id (parameterized)
Both exist - GET /users/me will match the static route first (correct behavior).
Missing Base Path
If your simulation has base path /api/v1, all routes are relative to that:
- Route path:
/users - Full URL:
https://<id>.srstg.io/api/v1/users
Method Mismatch
Routes are method-specific. A GET /users route won't match a POST /users request.
Trailing Slash
/users and /users/ are treated as different paths by default. Ensure consistency.
Debugging
- Check the Request Log to see which route matched (or didn't)
- Use the simulation's route list to verify the exact method and path
- Test with cURL to eliminate browser-specific issues