This does not work correctly, consider this route: `/compare/:commit/:commit2`

You should split the string on `/` character and replace items that have value equal to the key. See [Javascript implementation](https://github.com/strongloop/strong-remoting-clients/blob/58fe9f86a4ce8b58e2419a67bd33150101783fa6/js/adapters/rest-adapter.js#L79).