Eventually, we want e.g. /api/users/:id/profile to result in capturing id into a key-value data structure,
so we can e.g. do req.route("id") => 52 for the URI /api/users/52/profile.
While we don't have the regex-from-route-path-generator we know it's going to use regex capture groups, so we can still preserve these. We can now do e.g.: /api/users/(\d+)/profile, and provide the resulting matches in a datastructure. We don't have key names yet, so it will be
req.route_part(0) => 52 for the URI /api/users/52/profile.
Eventually, we want e.g.
/api/users/:id/profile
to result in capturingid
into a key-value data structure, so we can e.g. doreq.route("id")
=>52
for the URI/api/users/52/profile
.While we don't have the regex-from-route-path-generator we know it's going to use regex capture groups, so we can still preserve these. We can now do e.g.:
/api/users/(\d+)/profile
, and provide the resulting matches in a datastructure. We don't have key names yet, so it will bereq.route_part(0)
=>52
for the URI/api/users/52/profile
.