Skip to main content

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:

  1. Exact match - Static paths match first
  2. Parameterized match - :param segments match next
  3. 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

  1. Check the Request Log to see which route matched (or didn't)
  2. Use the simulation's route list to verify the exact method and path
  3. Test with cURL to eliminate browser-specific issues