Does anyone know of a REST request router with built-in support for URI Templates (per RFC 6570)? Using restify it seems possible to do simple string expansion (
https://tools.ietf.org/html/rfc6570#section-3.2.2). I'm specifically interested in reserved expansion (
https://tools.ietf.org/html/rfc6570#section-3.2.3) for an implementation where I'm using ":" to separate components of a URI. For example, I want to support a request like:
where {id} might look like "abc:def:ghi".
A restify handler like:
server.get('/some/resource/:name', respond);
will not match a request like:
It will instead respond with:
{"code":"ResourceNotFound","message":"/some/resource/abc:def:ghi does not exist"}
I can get it to work if I use a regexp handler like:
server.get(/\/another\/resource\/(.*)/, regexp_respond);
... which might be my only option.
Is anyone aware of a REST request router that will support (for example) the "{+var}" URI Template syntax, and/or other parts of RFC6570?
There are implementations out there like
https://github.com/fxa/uritemplate-js, but that seems to be in the wrong direction (it will expand a URI based on a URI Template, but it won't map/match/route request URIs against templates).
I apologize if I'm missing something fundamental here - I'm new to this space...
neil.