mcavage/node-restify — Issue #70: Matching /foo/:id.json
Author: BryanDonovan
Created: 2012-02-06 22:20:16+00:00
State: open

Hi,

What's the correct way to match a url like /foo/:id.json ?

Ideally, this test would pass, but I could see where there could be times when someone wants the ".xxx" part to be the actual param name.

```javascript
test('test matches param with .json extension', function(t) {
var route = new Route({
log4js: log4js,
url: '/foo/:id.json',
method: 'GET'
});
t.ok(route);
t.equivalent(route.matches({
method: 'GET',
path: '/foo/999.json'
}), { id: 999 });
t.end();
});
```

The output of that test (in 1.0.0-1-rc2) is:

```
FOUND: {"id.json":"999.json"}
WANTED: {"id":999}
```