deoxxa/houkou — pull request #2 by jden (2012-11-29 03:56:13+00:00)
Title: Custom parameter token character

With this patch, you can configure what character houkou uses to indicate a parameter. This is useful for using houkou to parse other types of strings besides URL paths - in my use case, cache keys.

Segments in the cache keys my application is using look like `seg1:seg2:another:segment` - so I wanted to change the character used to indicate a parameter from `:` to something else, for example, `!`.

This new usage is:

new Houkou("document:!id:section:!section:page:!page", {paramChar: '!'})

See the test added to `test/matching-test.js`.

I also added code to get an existing failing test to pass (`/hello/:name (:name only alphanumeric` in `test/building-test.js`).

cheers.